Skip to content

Escape < and > in rendered toc to match handlebars' escaping in <title>#1376

Merged
ehuss merged 1 commit into
rust-lang:masterfrom
dtolnay:html
Nov 10, 2020
Merged

Escape < and > in rendered toc to match handlebars' escaping in <title>#1376
ehuss merged 1 commit into
rust-lang:masterfrom
dtolnay:html

Conversation

@dtolnay
Copy link
Copy Markdown
Member

@dtolnay dtolnay commented Nov 9, 2020

The previous behavior was inconsistent with the rendering of <title> through handlebars, making it impossible to render a matching chapter name in both places.

Before:

SUMMARY.md rendered title rendered sidebar
[Vec<T>](vec.md) <title>Vec</title> <a ...>Vec</a>
[Vec&lt;T&gt;](vec.md) <title>Vec&lt;T&gt;</title> ✔️ <a ...>Vec<T></a>
[Vec&amp;lt;T&amp;gt;](vec.md) <title>Vec&amp;lt;T&amp;gt;</title> <a ...>Vec&lt;T&gt;</a> ✔️

After:

SUMMARY.md rendered title rendered sidebar
[Vec<T>](vec.md) <title>Vec</title> <a ...>Vec</a>
[Vec&lt;T&gt;](vec.md) <title>Vec&lt;T&gt;</title> ✔️ <a ...>Vec&lt;T&gt;</a> ✔️
[Vec&amp;lt;T&amp;gt;](vec.md) <title>Vec&amp;lt;T&amp;gt;</title> <a ...>Vec&amp;lt;T&amp;gt;</a>

@dtolnay dtolnay changed the title Escape &"<> in rendered toc to match <title> Escape < and > in rendered toc to match handlebars' escaping in <title> Nov 9, 2020
Copy link
Copy Markdown
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants