DuraSpace Confluence and JIRA will be offline for service upgrades on Sunday, 6/17 between 8pm - 11pm EDT
This recipe is written for the Manakin (XMLUI) interface supplied with Dspace >= 1.5.0. Compatibility with < 1.5.0 is not guaranteed.
This recipe will turn plain carriage returns/newlines in metadata text into proper HTML paragraph breaks when a simple item record is displayed. The nature of <p/> means that multiple carriage returns in a row will be rendered as a single paragraph break by the browser.
Create a new template, like:
Find or override the template that handles item display, eg.
If you want to render line breaks only for a specific metadata field (dc.description.abstract in this example), make sure you only call the template when that metadata is matched:
Then loop through each match and call the 'break' template:
Most of this code is already available in dri2xhtml/structural.xsl, it just needs the 'break' template added and the usual value-of select replaced by the call-template/with-param.
Note: Because this method uses <p/> tags to generate paragraph breaks, the first paragraph of the abstract will be differently formatted to the rest if a <p/> is not inserted before the first call to 'break'.