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

Allow HTML header anchor text to be HTML #1101

Merged
merged 1 commit into from
Sep 21, 2019
Merged

Conversation

choldgraf
Copy link
Contributor

In many projects it's common for anchor links to be icons (e.g., SVGs) or images embedded with something like FontAwesome. I've tried to get this working with nbconvert, but it supplying HTML for the anchor link text (e.g. <i class='far fa-link'></i>) gets sanitized into raw text instead of HTML.

This PR does a quick check to see if the supplied anchor text is valid HTML and, if so, appends it to the link object with the assumption that it should be treated as HTML. This lets you do things like add fontawesome icons for anchor links.

@@ -44,10 +44,10 @@


def wrap_text(text, width=100):
"""
"""
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All these whitespace fixes were auto-made by my editor, I can try to revert them if it's noise

Copy link
Contributor

Choose a reason for hiding this comment

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

All good imo. I do the same when touching files.

@choldgraf
Copy link
Contributor Author

build error is on the parallel notebooks job, which I don't think is related to this...

Copy link
Contributor

@MSeal MSeal left a comment

Choose a reason for hiding this comment

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

Test failure is a known issue in the python 2 kernel. Thanks for the change!

@@ -44,10 +44,10 @@


def wrap_text(text, width=100):
"""
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

All good imo. I do the same when touching files.

@MSeal MSeal merged commit 275f7f9 into jupyter:master Sep 21, 2019
@MSeal MSeal added this to the 5.6.1 milestone Oct 21, 2019
@MSeal MSeal added this to the 5.6.1 milestone Sep 8, 2020
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