kramdown-rfc icon indicating copy to clipboard operation
kramdown-rfc copied to clipboard

dl formatting

Open mnot opened this issue 3 years ago • 9 comments
trafficstars

using a DL in markdown produces XML like this:

          <dl>
            <dt>
Name  </dt>
            <dd>
              <t>dns_timeout</t>
            </dd>
            <dt>
Description  </dt>
            <dd>
              <t>The intermediary encountered a timeout when trying to find an IP address for the next hop hostname.</t>
            </dd>
            <dt>
Extra Parameters  </dt>
            <dd>
              <t>None.</t>
            </dd>
            <dt>
Recommended HTTP status code  </dt>
            <dd>
              <t>504</t>
            </dd>
            <dt>
Response only generated by intermediaries  </dt>
            <dd>
              <t>true</t>
            </dd>
            <dt>
Reference  </dt>
            <dd>
              <t>[RFC9209]</t>
            </dd>
          </dl>

whereas the RPC produces XML like this:

  <dl>
            <dt>Name:</dt><dd> dns_timeout</dd>
            <dt>Description:</dt><dd> The intermediary encountered a timeout when trying to find an IP address for the next-hop hostname.</dd>
            <dt>Extra Parameters:</dt><dd> None.</dd>
            <dt>Recommended HTTP status code:</dt><dd> 504</dd>
            <dt>Response only generated by intermediaries:</dt><dd> true</dd>
            <dt>Reference:</dt><dd> RFC 9209</dd>
          </dl>

Is it possible to change the whitespace of the output to look more like the RPC's, to avoid unnecessary diffs?

mnot avatar Feb 24 '22 23:02 mnot

It's easy to remove the spurious newline ahead of the <dt content and the spurious spaces after it. Staying on the same line for <dd only appears to make sense for newline=false style <dd. Also, kramdown-rfc will saddle you with <t around the <dd content, and that is much harder to get rid of at the moment.

cabo avatar Feb 24 '22 23:02 cabo

And it will be hard to emulate those weird spaces after <dd>.

cabo avatar Feb 24 '22 23:02 cabo

With 7c0f82c the output now looks peachy clean to me. Why can't the RFC editor stick with that?

cabo avatar Feb 24 '22 23:02 cabo

That's fine, I'm sure -- part of the problem here is that often people define things as lists and the RPC converts them to DLs.

Thanks! (will this be in a release soon?)

mnot avatar Feb 24 '22 23:02 mnot

I can push it any day, do you want it now?

cabo avatar Feb 25 '22 00:02 cabo

that would be helpful, yes :)

mnot avatar Feb 25 '22 00:02 mnot

Done (1.6.2).

I'm not closing this issue, because it would be nice to address the rest of the problem as well.

cabo avatar Feb 25 '22 00:02 cabo

Thanks!

mnot avatar Feb 25 '22 00:02 mnot

The extra space is an artefact of them converting it from a list, so don't worry about it (they kindly removed it for me).

They've also put dt and dd on separate lines for me, so the only big thing left is the spurious t, I think.

mnot avatar Feb 25 '22 22:02 mnot