Enter a new paragraph line without spacing

Questions about XML that are not covered by the other forums should go here.
Olivier
Posts: 8
Joined: Fri Apr 21, 2023 12:57 pm

Enter a new paragraph line without spacing

Post by Olivier »

Hi,
Could you please advise on how to insert a line break without spacing in oxygen xml, ie like the Shift+Enter shortcut in msword.
Note the only way I have found to insert a carriage return is to insert a new paragraph, which obviously generates the inter-paragraph spacing set in the css...
Thanks in advance!
Olivier
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Enter a new paragraph line without spacing

Post by Radu »

Hi Olivier,
There is no "soft line break" element in the DITA XML standard which would be the equivalent of <br>.
There is a special processing instruction "<?linebreak?>" which should be already handled by the publishing stylesheets.
For example in a DITA topic in the middle of a paragraph if working in the Author mode you press ENTER, select "processing-instruction" and then insert linebreak inside the processing instruction. Then publish and see how that looks like.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Olivier
Posts: 8
Joined: Fri Apr 21, 2023 12:57 pm

Re: Enter a new paragraph line without spacing

Post by Olivier »

Thanks Radu,
I guess I should have specified that I was trying to enter table heading content on multiple lines whilst avoiding the spacing which <p> elements naturally generate between them.
I found a solution using a <div> element:

Code: Select all

<entry>Unused <div>(31-9)</div></entry>
instead of

Code: Select all

<entry><p>Unused </p>
              <p>(31-9)</p></entry>
Works fine for table headers.

Note: Your solution returns the following error in a usual paragraph:
The processing instruction must begin with the name of the target
Radu
Posts: 9059
Joined: Fri Jul 09, 2004 5:18 pm

Re: Enter a new paragraph line without spacing

Post by Radu »

Hi,
Right, using the <div> element to break the line is not semantically correct but it works :)
About this remark:
Note: Your solution returns the following error in a usual paragraph:
The processing instruction must begin with the name of the target
You probably did something wrong when inserting it.
I'm attaching an animated gif.
linebreak.gif
linebreak.gif (238.72 KiB) Viewed 514 times
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply