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

Can it add an invisible <a> tag into each heading tag (h2~h6), when converting md to html? #3

Closed
Zhaopudark opened this issue May 23, 2024 · 1 comment

Comments

@Zhaopudark
Copy link
Owner

Zhaopudark commented May 23, 2024

I usually use this module to make up a Pandoc filter and apply it when using hexo with hexo-renderer-pandoc.

I have found it will be very helpful if it can add an invisible header link (<a>) into each header (<h2>~<h6>) when rendering md to HTML.

For example, the original md is as:

## test

And the expected HTML after converting is as:

<h2 id="test"><a href="#test" class="headerlink" title="test"></a>test</h2>

Can this module support it?

@Zhaopudark Zhaopudark changed the title Can it add <a> tag into each heading tag (h2~h6), when converting md to html? Can it add an invisible <a> tag into each heading tag (h2~h6), when converting md to html? May 23, 2024
@Zhaopudark
Copy link
Owner Author

Zhaopudark commented May 23, 2024

The PR #4 has realized this feature.

Note, in PR #4, all headers (<h1>~<h6>) will be inserted with an invisible header link.

Sometimes, in some renderers/frameworks/tools, the <h1> will be considered specially to form a title. But we hold the view that, in most cases, this special behavior does not conflict with PR #4 in terms of the visible effects. So, we make PR #4 influence all headers (<h1>~<h6>) for simplification, instead of ignoring <h1>.

@Zhaopudark Zhaopudark assigned Zhaopudark and unassigned Zhaopudark Oct 16, 2024
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

No branches or pull requests

1 participant