Author Mode: Too much whitespace in list items with plain text

Post here questions and problems related to editing and publishing DITA content.
Frank Ralf
Posts: 444
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Author Mode: Too much whitespace in list items with plain text

Post by Frank Ralf »

Hi,

In Author Mode, a list which entries contain plain text, shows additional whitespace compared to the same list where the entry content is surrounded by an additional <p> tag. I have deactivated all custom CSS but the issue also shows with the default styles of Oxygen. Am I missing something?

Best regards,
Frank

Code: Select all

<section id="ol-without-p">
      <title>Ordered list without &lt;p></title>
      <ol>
        <li> This is some text in a list <ol>
            <li> This is the first indented list item<ol>
                <li> Third level item.<ol>
                    <li> Forth level item<ol>
                        <li> Level 5 </li>
                      </ol>
                    </li>
                  </ol>
                </li>
              </ol>
            </li>
            <li> This is the second indented list item </li>
          </ol>
        </li>
        <li> This is another item in the main list </li>
      </ol>
    </section>
Frank Ralf
parson AG
www.parson-europe.com
Radu
Posts: 8734
Joined: Fri Jul 09, 2004 5:18 pm

Re: Author Mode: Too much whitespace in list items with plain text

Post by Radu »

Hi Frank,

You mean these extra spacings which appear, right?
Screenshot 2023-05-24 at 08.27.23.png
Screenshot 2023-05-24 at 08.27.23.png (33.99 KiB) Viewed 410 times
These are single spaces which are preserved by Oxygen.
Let's take this case for example:

Code: Select all

<li> Forth level item<ol>
                                <li> Level 5 </li>
                            </ol>
                            </li>
Oxygen considers that the list item "<li> Forth level item..." has mixed content, it contains both text and tags. In such cases when presenting content in the Author mode Oxygen collapses consecutive spaces to a single space but leaves that space there. So the indentation between:

Code: Select all

</ol>
                            </li>
is collapsed to a single space in the Author mode but is left there on a new line as it comes after a block element which is <ol>.
This is how Oxygen has always worked.
If I were to use only the Author mode to insert the list item and then the ol inside it, the serialized content would look like this:

Code: Select all

            <ol id="ol_ahs_21l_4xb">
                <li>some text <ol id="ol_nsx_21l_4xb">
                        <li>li</li>
                    </ol></li>
            </ol>
so notice there is no space between "</ol></li>".
Also if you format and indent in Oxygen this content:

Code: Select all

<ol id="ol_ahs_21l_4xb">
                <li>some text <ol id="ol_nsx_21l_4xb">
                        <li>li</li>
                    </ol></li>
            </ol>
Oxygen will not add new lines and indentation between "</ol></li>".

But I suspect you are manually adding new lines and indentation between "</ol></li>" in the Text editing mode or using another tool to format and indent it.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Frank Ralf
Posts: 444
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: Author Mode: Too much whitespace in list items with plain text

Post by Frank Ralf »

Hi Radu,

Many thanks for the quick reply and the detailed explanation. I worked in Text mode and used "Format and Indent" for formatting the source code. If this issue does not happen in Author mode, that would explain why none of the authors has stumbled upon this yet. :wink:

Kind regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
Radu
Posts: 8734
Joined: Fri Jul 09, 2004 5:18 pm

Re: Author Mode: Too much whitespace in list items with plain text

Post by Radu »

Hi Frank,
Actually even if you format and indent in the Text mode using the default settings an XML like this:

Code: Select all

<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="topic_wrb_f1s_4xb">
    <title></title>
    <body>
        <p>
            <ol>
                <li>some text <ol>
                    <li>some other text</li>
                </ol></li>
            </ol>
        </p>
    </body>
</topic>
Oxygen's Format and Indent will never add a space between "</ol></li>". So you probably added that space manually by pressing enter between "</ol></li>".
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Frank Ralf
Posts: 444
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: Author Mode: Too much whitespace in list items with plain text

Post by Frank Ralf »

Thanks for the information, Radu. I probably have changed the default settings. Will check and report back.

Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
chrispitude
Posts: 875
Joined: Thu May 02, 2019 2:32 pm

Re: Author Mode: Too much whitespace in list items with plain text

Post by chrispitude »

Hi Frank,

We try to enforce a rule here that any text in <li> and <dd> elements must be in <p> elements. This ensures that the formatting and margins are consistent for content inside and outside list items. With this convention, spacing across the block elements inside an <li> element has no effect on formatting.

(We do not enforce this in <entry> table cell elements because a single piece of text there will naturally be margined by its containing cell.)

- Chris
Frank Ralf
Posts: 444
Joined: Thu Jan 23, 2014 2:29 pm
Location: Hamburg
Contact:

Re: Author Mode: Too much whitespace in list items with plain text

Post by Frank Ralf »

Hi Chris,

Thanks for your suggestion. The customer actually had exactly this specialization before. But they are now moving to standard DITA which allows that kind of mixed content.

Best regards,
Frank
Frank Ralf
parson AG
www.parson-europe.com
Post Reply