Linebreaks in HTML export

Post here questions and problems related to editing and publishing DITA content.
IanMayo
Posts: 5
Joined: Thu Jun 08, 2023 6:46 pm

Linebreaks in HTML export

Post by IanMayo »

I have read that the <?linebreak?> processing instruction can be used to force a linebreak in published output, effectively replacing the HTML <br> element.

But, it seems to have no effect when I publish a simple DITA doc using the Oxygen WebHelp publishing template. There certainly isn't a BR at the relevant location in the published output.
marius
Posts: 39
Joined: Thu Mar 05, 2009 11:44 am

Re: Linebreaks in HTML export

Post by marius »

Hi,
In Oxygen XML Editor 26.0, in a DITA topic I inserted several <?linebreak?> PI's, then I ran the default DITA Map WebHelp Responsive transformation scenario. All PI's where translated to <br> elements in the HTML output.
So my DITA topic look like this:
in.png
in.png (414.76 KiB) Viewed 382 times
And the output I get is:
out.png
out.png (321.8 KiB) Viewed 382 times
Marius Ciolacu
Syncro Soft / Oxygen XML
IanMayo
Posts: 5
Joined: Thu Jun 08, 2023 6:46 pm

Re: Linebreaks in HTML export

Post by IanMayo »

Thanks for your support Marius,
based on you demonstrating that it "should" work, I persevered, and realised I was adding the special element in `author-mode` rather than `plain-text-mode`.
The feature does work :-D
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Linebreaks in HTML export

Post by Radu »

Hi,
To add in the Author mode a processing instruction named <?linebreak?> you need to press ENTER, then choose "processing-instruction" and then inside the newly added processing instruction type "linebreak". Otherwise if you just type "<?linebreak?>" in the Author visual editing mode you get plain text.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply