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

Fix issue where html elements in H1's cause footer layout to be broken #1217

Merged
merged 2 commits into from
Aug 22, 2019
Merged

Fix issue where html elements in H1's cause footer layout to be broken #1217

merged 2 commits into from
Aug 22, 2019

Conversation

timpharo
Copy link
Contributor

Expected Behaviour

When adding a html tags to H1's in markdown files, such as Font awesome icons, the footers next/previous links should look as expected

Current Behaviour

Adding html to H1's in markdown files displays the html correctly in the link itself, but as the H1 is injected into the title attribute of the link, which is invalid as this should not contain html, the layout breaks

Possible Solution

Stripping all html when reading the property in as a Jinja template. This PR addresses the issue in this way.

Steps to Reproduce

  1. Add fontawesome_markdown extension and awesome-pages plugin
  2. Add Font Awseome icon to any .md file
  3. Navigate to an adjacent page to the one you have edited
  4. The footer layout will be broken because the html is injected into the links title attribute

@squidfunk squidfunk merged commit a47f1ef into squidfunk:master Aug 22, 2019
@squidfunk
Copy link
Owner

LGTM!

@squidfunk
Copy link
Owner

Released as part of 4.4.1.

@timpharo
Copy link
Contributor Author

Thanks for the quick turn around, now I can remove the partial from our code.

StanzillaManticore pushed a commit to ManticoreGamesInc/mkdocs-material that referenced this pull request Dec 11, 2019
…ken (squidfunk#1217)

* Add striptags to next/previous links to eascape invalid html tags

* Add generated built files for escaped titles in footer
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.

None yet

2 participants