You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I’ve just installed the gem into a Rails app and without passing in any options, Commonmarker is generating HTML headings with an anchor link inside of them:
% bin/rails c
Loading development environment (Rails 7.2.1.1)
app(dev)> Commonmarker.to_html("# Foo")
=> "<h1><a href=\"#foo\" aria-hidden=\"true\" class=\"anchor\" id=\"foo\"></a>Foo</h1>\n"
However, autolinking is something I do want. Is there a way to disable these heading anchor from being generated, while retaining the standard autolink functionality?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Yes, I’m having a big think about defaults at the moment. Actually #315 is a more general bug around the issue you faced with autolink: false. Apparently, the defaults aren’t getting merged correctly, and no one has noticed until now!
Hello,
I’ve just installed the gem into a Rails app and without passing in any options, Commonmarker is generating HTML headings with an anchor link inside of them:
I was expecting this:
The output is surprising to me because there is no mention of these anchors in the CommonMark spec or in the GitHub Flavored Markdown spec.
If you put the example above into the playground/interactive dingus on the CommonMark website, it outputs what I was expecting:
If you disable the
autolink
extension, the anchor is not generated:However, autolinking is something I do want. Is there a way to disable these heading anchor from being generated, while retaining the standard autolink functionality?
Thanks in advance!
The text was updated successfully, but these errors were encountered: