v0.11.0
HTML in a README stops being a second-class document. A <table> and a
<ul> now walk to the same block their markdown spelling produces, so the
column solver and the list emitter draw them without ever learning there was
a second source of cells or items — spans, sections, captions and alignment
on one side; markers, indent, ordered numbering and nesting on the other.
What happened before was all-or-nothing: one <table> anywhere, or one
<ul> inside a <details>, sent its whole block to the page as raw tags.
Both come with the tag-omission rules the markup they meet actually has.
<tr><td>a<td>b is two cells and <li>a<li>b is two items, rather than
each one nested inside the one before it; and a table or a list split by a
blank line — which ends the HTML block, and is the form GitHub requires for
markdown to render inside — is gathered back into one.
Three fixes to markdown tables fell out of the table work: a header with no
rows under it drew a doubled bottom edge, a cell containing a line break
claimed the width of all its lines at once, and card layout centred each
value behind its label. Links inside a framed cell are now interned, so ]
walks a contributor grid.
A minor rather than a patch because it renders markup 0.10.0 declined.
cargo semver-checks against v0.10.0 reports nothing: the stable half of the
library API, render and theme, is untouched.
891 tests and a doctest, up from 853.
Added
-
HTML
<ul>,<ol>and<li>are rendered as a list, not as tags. A
list in a README walks to the same block a markdown list produces, so the
markers, the indent, the ordered numbering and a list nested in an item all
apply to it unchanged — the list emitter was not touched, and nothing
downstream can tell which source the items came from.An item holds blocks, so everything the HTML reader can make reaches an item
too: a heading, a paragraph, a quote, a table, another list.<ol start>is
honoured.</li>written and left out are both understood —<li>a<li>bis
two items, not one item holding the other, which is the list's half of the
tag-omission rule tables already had. A list split by a blank line — which
ends the HTML block, so its items arrive loose — is gathered back into one,
and a stray paragraph inside a list joins the item above it rather than
disappearing.This is also what stops one
<ul>from taking a whole<details>block to
the page as markup, which is what it did before.Limits, deliberate: a list inside a table cell keeps one item per line but
loses its markers, because a cell holds inline content and a marker
synthesized there would land in the plain mirror as searchable text. The
same rule costs a list split by a blank line its numbering, because the
<ol>that said so is in an earlier block.type,reversedandvalue
are not read; the block tree has no way to say them. And<dl>/<dt>/<dd>
is still declined to literal markup: there is no term-and-definition shape
in the block tree and no way to indent without a marker, so a bulleted<dl>
would be a guess rendered as if it were known. -
HTML
<table>is rendered as a table, not as tags. A<table>in a
README walks to the same block a markdown pipe table produces, so the
column solver, the box drawing, the shaded header band and the narrow-width
label: valuecards all apply to it unchanged —solve_widthswas not
touched, and nothing downstream can tell which source the cells came from.What it understands is what READMEs actually contain:
<thead>/<tbody>/
<tfoot>(the footer renders last wherever it was written), a leading row
of<th>as the header when<thead>was left out,alignon a cell, row
or table,colspanandrowspan,<caption>as a strong paragraph above
the table, a<br>inside a cell, and<td>/<tr>written without their
closing tags. A<center>or<div align>around the table lends it their
alignment, and a table split by a blank line — which ends the HTML block, so
its rows arrive loose — is gathered back into one.Three fixes fell out of it and apply to markdown tables too: a header with
no rows under it drew a doubled bottom edge, a cell containing a line break
claimed the width of all its lines at once, and card layout centred each
value behind its label instead of setting it flush.Links inside a framed cell are now interned, so
]walks a contributor
grid; before this they were on the page but not reachable.Limits, deliberate: a table inside a table is declined to literal markup,
because a cell holds inline content and nesting could only flatten the
inner one into a run-on sentence. A cell holding an element with no emitter
—<pre>,<input>,<dl>— still sends the whole block to literal
markup, because the scan that declines runs over the block rather than the
cell.style="text-align:…"is not read; only thealignattribute is.
Per-cell alignment is not representable, so a column takes the header
cell's alignment or the first body cell that states one. And search matches
a table line by line, so a phrase that wraps inside a cell is not found
across the wrap.