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

Modify md2html_hash_anchor_and_internal_link_filter to add an invisib… #4

Merged
merged 2 commits into from
May 23, 2024

Conversation

Zhaopudark
Copy link
Owner

@Zhaopudark Zhaopudark commented May 23, 2024

To handle #3,

Modify md2html_hash_anchor_and_internal_link_filter to add an invisible link for each header.

  • Now, for each header, an invisible link that links to the header itself will be added to it.
  • The added invisible link will be assigned the class of headerlink.
  • This will be useful for generating anchors by some renderers/frameworks/tools, such as hexo-theme-butterfly.

Note, 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 this PR in terms of the visible effects. So, we make it influence all headers (<h1>~<h6>) for simplification, instead of ignoring <h1>.

Copy link

codecov bot commented May 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.27%. Comparing base (62bac98) to head (7a33b12).

Additional details and impacted files
@@            Coverage Diff             @@
##             main       #4      +/-   ##
==========================================
+ Coverage   93.23%   93.27%   +0.04%     
==========================================
  Files          22       22              
  Lines         458      461       +3     
==========================================
+ Hits          427      430       +3     
  Misses         31       31              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Zhaopudark Zhaopudark merged commit e8463ae into main May 23, 2024
3 checks passed
@Zhaopudark Zhaopudark deleted the dev branch May 23, 2024 07:42
@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

Successfully merging this pull request may close these issues.

1 participant