Repository navigation
Conversation
Heading text is wrapped in the heading's own `<a href="#label">`. Cross references, URLs and `rdoc-ref:` links in the text were turned into links too, which produced nested `<a>` tags (invalid HTML). Convert the heading text as a link label, the way tidy link labels already are, so it is rendered as plain text. Tidy links now restore the previous label state instead of clearing it, so text after a tidy link in a heading stays unlinked as well.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Heading text is wrapped in the heading's own
<a href="#label">, but cross references, URLs andrdoc-ref:links inside it were still turned into links. A heading such as= C1or= EXAMPLE.mdtherefore rendered as<a href="#c1"><a href="C1.html"><code>C1</code></a></a>, the nested anchors described in #1635.accept_headingnow converts the heading text as a link label, the same way tidy link labels are already handled, so cross references and URLs in it stay plain text. The table of contents already strips cross references from heading text (Heading.to_html), so the body heading now matches it. Links in the rest of the document are unchanged.handle_TIDYLINKused to reset the label state tofalsewhen it finished. It now restores the previous value, so text after an explicit tidy link in a heading also stays unlinked. The explicit tidy link itself is still emitted as before.Fixes #1635