ietf-tools / xml2rfc

Generate RFCs and IETF drafts from document source in XML according to the IETF xml2rfc v2 and v3 vocabularies
https://ietf-tools.github.io/xml2rfc/
BSD 3-Clause "New" or "Revised" License
63 stars 35 forks source link

missing number in text output of <ol> #1135

Open mchurch-rpc opened 4 days ago

mchurch-rpc commented 4 days ago

Describe the issue

In Section 4.6 of RFC-to-be-9599, the <ol> tag contains two <li> tags, but the "2" for the second <li> tag does not appear in the text output.

Input:

input

Desired output: desired output (which is how it looks in the HTML and PDF outputs)

Actual output (not desired): actual output (not desired)

Various workarounds have been tried by the author and the RPC without success.

Code of Conduct

kesara commented 23 hours ago

HTML on Safari (both macOS and iOS) is not looking good either:

Screenshot 2024-07-09 at 13 30 39

Renders correctly on Firefox and Google Chrome. EDIT: Created #1136 for this issue.

kesara commented 22 hours ago

@mchurch-rpc, As a workaround text content inside <li> can be encapsulated with a <t> tag. For example:

<ol spacing="normal" type="1">
  <li anchor="ecnencap_reframing_goal_presence">approximate
    preservation of the presence (and therefore timing) of congestion
    marks on the L2 frames used to construct an IP packet;
  </li>
  <li anchor="ecnencap_reframing_goal_proportion">
    <ol spacing="normal" type="a">
      <li>
        <t>at high frequency of congestion marking, approximate
          preservation of the proportion of congestion marks arriving
          and departing;
        </t>
      </li>
      <li>
        <t>at low frequency of congestion marking, approximate
          preservation of the timing of congestion marks arriving and
          departing.
        </t>
      </li>
    </ol>
  </li>
</ol>
kesara commented 16 hours ago

Another option is to use type="%p%c" in inner <ol>^1.

Example:

<ol spacing="normal" type="1">
  <li anchor="ecnencap_reframing_goal_presence">
    approximate preservation of the presence (and therefore timing) of congestion marks on the L2 frames used to construct an IP packet;
  </li>
  <li anchor="ecnencap_reframing_goal_proportion">
    <ol spacing="normal" type="%p%c">
      <li>
        at high frequency of congestion marking, approximate preservation of the proportion of congestion marks arriving and departing;
      </li>
      <li>
        at low frequency of congestion marking, approximate preservation of the timing of congestion marks arriving and departing.
      </li>
    </ol>
  </li>
</ol>

Output:

   1.  approximate preservation of the presence (and therefore timing)
       of congestion marks on the L2 frames used to construct an IP
       packet;

       2.a  at high frequency of congestion marking, approximate
            preservation of the proportion of congestion marks arriving
            and departing;

       2.b  at low frequency of congestion marking, approximate
            preservation of the timing of congestion marks arriving and
            departing.
kesara commented 3 hours ago

Another example of this bug is

      <ol spacing="normal" type="A">
        <li>
          <ol spacing="normal" type="I">
            <li>
              Item A_I
            </li>
            <li>
              Item A_II
            </li>
          </ol>
        </li>
        <li>
          <t>Item B</t>
        </li>
      </ol>

generates:

       I.   Item A_I

       II.  Item A_II

   B.  Item B