fix: Respect newline attr on dl tag #1047
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1045
Bug was expecting
split(stripspace...)
to treat its argument the same way asstrip(stripspace)
. The latter strips any of the individual characters instripspace
. The former splits on exactly the full string, not any of its characters. As a result, when calculating whether the first word of<dd>
would fit alongside the<dt>
text, the entire<dd>
text was used. This was introduced in #1023.A second bug caused the calculation actually to compare the length of the
<dd>
text to the full output width without actually accounting for the length of the<dt>
text already on the line. This bug was present for a long time but would only manifest if the<dt>
text plus the first word of<dd>
should have overflowed the width, which would not be common.This patch fixes both bugs and refactors the code to be more clear in its intention. The
newline
attribute should now match what's described at https://www.ietf.org/archive/id/draft-rswg-xml2rfcv3-implemented-02.html#section-3.20.3