dspace-angular icon indicating copy to clipboard operation
dspace-angular copied to clipboard

Preserve line breaks in metadata

Open alawvt opened this issue 3 years ago • 3 comments

Describe the bug It is very important that DSpace not alter metadata.

In DSpace 6 XMLUI. Line breaks in the metadata are preserved even though they are not displayed on the front end. DSpace6_XMLUI_linebreak_front DSpace6_XMLUI_linebreak_back

However, in DSpace 7 Demo, line breaks are removed when loaded to the metadata. They are not displayed on the front end. DSpace7_linebreak_back DSpace7_linebreak_front

Please preserve line breaks. (We'd be even happier if they were displayed!)

This bug is a show-stopper for us. We can't risk 35,000+ carefully formatted ETD abstracts until this is fixed.

To Reproduce Steps to reproduce the behavior:

  1. Do this
  2. Then this...

Expected behavior A clear and concise description of what you expected to happen.

Related work Link to any related tickets or PRs here.

alawvt avatar Aug 11 '22 20:08 alawvt

A developer interested in this ticket may also want to claim #1763 (which is related)

tdonohue avatar Aug 17 '22 14:08 tdonohue

We'd like to claim this, https://github.com/DSpace/dspace-angular/issues/1763 and https://github.com/DSpace/dspace-angular/issues/1404.

The idea is to add support for line breaks by default, and optional support (disabled by default) for markdown (with a mathjax plugin enabled) in abstracts.

That would allow users to use either HTML or markdown to mark up their abstracts, and allow us to render mathjax and easily add any of the markdown-it plugins that exist to easily add support for things like table of contents', latex, footnotes, etc later on.

This will take an estimated 8 hours

artlowel avatar Aug 18 '22 09:08 artlowel

@artlowel : Sounds fine & I'll assign back to you.

Just as a note though, I do want to caution that we may want to look at a way to strip some HTML out of abstracts. For example, we may want to consider blocking some tags like <script>, <embed> and <frame> (and similar). I.e. if there's a way to limit to formatting HTML tags, that'd be the ideal. While Angular seems to block JS from running, it's in our best interest to avoid certain HTML tags being used.

tdonohue avatar Aug 18 '22 13:08 tdonohue

As implemented on DSpace 7.4 Demo,

DSpace7_4_edit_item_line_breaks DSpace7_4_iitem_view_html_line_breaks

Line breaks are preserved and displayed. Thank you very much.

HTML is not displayed. @tdonohue, Is HTML disabled in the settings for DSpace 7 Demo?

alawvt avatar Oct 11 '22 20:10 alawvt

@alawvt : To clarify, HTML is not displayed at this time in these fields (this is being discussed in a separate ticket: #1495) . However, Markdown and MathJax is supported when enabled: https://wiki.lyrasis.org/display/DSDOC7x/User+Interface+Configuration#UserInterfaceConfiguration-Markdown/MathJaxSettings

It looks like it's not yet enabled on the Demo site, but will push out some updates to the demo site this week (likely tomorrow) to enable it.

tdonohue avatar Oct 11 '22 20:10 tdonohue

@tdonohue, thank you for this information. I would like to test the Markdown and MathJax when it is enabled. Should I start another feature request to support HTML in the abstract field?

alawvt avatar Oct 11 '22 20:10 alawvt

@alawvt : It turns out that I was wrong. The Markdown support includes support for basic HTML tags. The docs were just updated to clarify that: https://wiki.lyrasis.org/display/DSDOC7x/User+Interface+Configuration#UserInterfaceConfiguration-SettingsforrenderingMarkdown,HTMLandMathJaxinmetadata

I've also just pushed an update to the demo site to enable both Markdown (with HTML) and MathJax. HTML tags in abstracts should now be working on the demo site

tdonohue avatar Oct 12 '22 14:10 tdonohue

@tdonohue, Thank you for checking this and adding it to the documentation. Thank you also for adding the settings to the DSpace 7 Demo home page. Here is the same page with the HTML enabled. DSpace7_4_item_view_html_enabled

alawvt avatar Oct 13 '22 18:10 alawvt