Add support for line breaks markdown and mathjax in metadata#1851
Conversation
b3a773d to
d3e6d39
Compare
|
This pull request introduces 1 alert when merging eb4cda4 into edd193a - view on LGTM.com new alerts:
|
|
@samuelcambien : This appears to have lint errors (try running Additionally, the size of this PR is massive (15K lines) because it is somehow attempting to replace the entire Maybe you've somehow accidentally changed all the line endings in |
eb4cda4 to
2eb8243
Compare
|
This pull request introduces 1 alert when merging 2eb8243 into 001d6dc - view on LGTM.com new alerts:
|
2eb8243 to
c744b3d
Compare
|
This pull request introduces 1 alert when merging c744b3d into 001d6dc - view on LGTM.com new alerts:
|
829f9aa to
c04a982
Compare
…or line breaks, markdown and mathjax in metadata
…wn_and_mathjax_in_metadata # Conflicts: # package.json # src/app/shared/shared.module.ts # src/app/shared/truncatable/truncatable-part/truncatable-part.component.html # src/config/app-config.interface.ts # src/config/default-app-config.ts # src/environments/environment.test.ts # src/styles/_global-styles.scss # yarn.lock
…or line breaks, markdown and mathjax in metadata - fix lint issues
80207b0 to
f57fb39
Compare
…or line breaks, markdown and mathjax in metadata - add sanitize-html types to devdependencies for documentation
|
Hi @tdonohue, I've fixed the issues you mentioned. |
|
@samuelcambien : Apologies but this now has minor merge conflicts (likely caused by the recent merge of #1780). Could you rebase it when you get the chance? |
a8c1de3 to
1789a43
Compare
1789a43 to
7771cff
Compare
Hi @davide-negretti, great suggestion. Implementing this isn't very hard, but it looks a bit weird with the current truncatable-part components (see screenshot). An option would be to add a gradient to the bottom here, but this is currently out of scope. |
|
@samuelcambien : It appears this PR is now failing unit tests? Could you see if those could be fixed? |
|
Regardless of the mixed results with MathJax, I'm still +1 on this, as-is (assuming we can resolve the test failure) |
tdonohue
left a comment
There was a problem hiding this comment.
@samuelcambien : Overall, this is working better. But, in Production mode, I cannot load an Item page (where the Item has an abstract with mathjax & markdown) when this feature is disabled.
Here's what I tried:
- Create an Item with Markdown & MathJax in the abstract (your test item is perfectly good)
- Start in production mode (
yarn build:prod; yarn serve:ssr) - Turn this feature off. I.e. don't add the
markdownsection to yourconfig.prod.yml - Visit the Item you created. The abstract won't load & this error appears in the console:
ERROR TypeError: Cannot read properties of undefined (reading 'enabled')
at MetadataValuesComponent_ng_container_2_Template (C:\Users\donohue\programming\dspace-angular\dist\server\main.js:1:1792568)
If I enable the feature, then it does work in Prod mode. The error only occurs when disabled.
This PR is also currently failing some specs, so that also needs to be addressed. Thanks!
85a73ef to
e3351eb
Compare
|
I've repaired the tests, the ItemPageFieldComponent test's config change was breaking the ItemPageAbstractFieldComponent test. |
tdonohue
left a comment
There was a problem hiding this comment.
👍 Thanks @samuelcambien ! The fixes work for me now. I've retested today in production mode and everything works well. I've tried the default settings (both disabled) and also enabling just markdown and both markdown & mathjax. Looks good now!
|
Thank you very much, @samuelcambien and everyone, for working on this important improvement. Could someone add a screenshot of the test file with the configurations enabled, so can compare to it in our future testing? Thanks. |
|
@alawvt : To enable both features in your By default both are |






References
Description
This PR focuses on two things:
Instructions for Reviewers
List of changes in this PR:
To test this PR, create an item with line breaks, markdown and mathjax code (for instance this item), and verify that everything renders correctly.
Checklist
yarn run lintpackage.json), I've made sure their licenses align with the DSpace BSD License based on the Licensing of Contributions documentation.