Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Nov 10, 2020

Conversation

dtolnay
Copy link
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
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