Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plain text rendering in description should honour newline characters #455

Open
jsheunis opened this issue May 22, 2024 · 2 comments
Open
Labels

Comments

@jsheunis
Copy link
Member

No description provided.

@jsheunis
Copy link
Member Author

jsheunis commented May 22, 2024

Looks like this will solve it: https://stackoverflow.com/a/41495115:

<span style="white-space: pre-wrap;"></span>

@jsheunis
Copy link
Member Author

the diff to fix the issue:

diff --git a/datalad_catalog/catalog/templates/dataset-template.html b/datalad_catalog/catalog/templates/dataset-template.html
index d9f53c6..f06af76 100644
--- a/datalad_catalog/catalog/templates/dataset-template.html
+++ b/datalad_catalog/catalog/templates/dataset-template.html
@@ -190,11 +190,11 @@
         <b-row no-gutters>
           <b-col md="9" style="text-align: justify;">
             <b-card-text>
-              <strong>Description:</strong>
+              <strong>Description:</strong><br>
               <span v-if="displayData.description && Array.isArray(displayData.description) && displayData.description.length>0 ">
-                <span v-for="desc in displayData.description">{{desc}}<br></span>
+                <span v-for="desc in displayData.description" style="white-space: pre-wrap;">{{desc}}<br></span>
               </span>
-              <span v-else>{{selectedDataset.description}}</span>
+              <span v-else style="white-space: pre-wrap;">{{selectedDataset.description}}</span>
             </b-card-text>
           </b-col>
           <b-col md="3">

or as a patch file:

whitespace_patch.patch

@jsheunis jsheunis added the v2 label Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant