Repository navigation
Highlights
Blocks inside a link no longer run together
When a link wraps block elements and the HTML has no whitespace between them, as on minified news pages that wrap each teaser in a link, the texts of those blocks were joined without a separator. They are now separated by a single space, unless whitespace is already there:
| Input | 6.3.0 | 6.3.1 |
|---|---|---|
<a href="x"><h3>Second headline</h3><p>A summary of it.</p></a> |
[Second headlineA summary of it.](x) |
[Second headline A summary of it.](x) |
<a href="x"><div>One</div><div>Two</div></a> |
[OneTwo](x) |
[One Two](x) |
<a href="x"><ul><li>One</li><li>Two</li></ul></a> |
[OneTwo](x) |
[One Two](x) |
The same applies to other inline elements, such as <del> and <strong>. Pretty-printed HTML converts as before.
No more links to nothing
In flavors that do not keep raw HTML (Default, Slack, Telegram, Pandoc):
- An
<a>withouthref, such as<a name="top"></a>or<a id="x"></a>, keeps only its content instead of becoming[](). - A link with nothing visible inside is dropped and its whitespace kept, so
x <a href="x"></a> ygivesx y. This also removes the[](x)left behind when a<div>inside a link closes the surrounding<p>. - A link around only an image is still a link.
time, data, bdi and bdo keep only their text
These tags change nothing visible, but they used to pass through as raw HTML as unknown tags. In the same flavors they now keep only their text, so <time datetime="…">vor 22 Minuten</time> inside a teaser link gives vor 22 Minuten. Tags.PassThrough, Tags.Replacer and custom readers still take precedence.
CommonMark, GitHub and MultiMarkdown still keep empty links, named anchors and these four tags as raw HTML.
Behavior changes
The last two highlights change default output for HTML that relied on the old behavior. To keep one of the four tags as HTML, add it to Tags.PassThrough.
What's Changed
- fix: separate blocks flattened into an inline element with a space by @mysticmind in #441
- fix: drop empty links and unwrap semantic-only tags in clean flavors by @mysticmind in #442
Thanks to @SommerEngineering for the detailed report in #440.
Full Changelog: 6.3.0...6.3.1