-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Implement Optional Footnote References Ignore #311
Conversation
Hey @petervaro , thank you for your contribution! I did a quick check and it seems the tokenization doesn't quite work as anticipated in this case #312 The testsuite is not known to be flaky. Could you possibly reference the commonmark spec where the syntax is outlined? I am not an avid footnote user. |
2e17219
to
12e0e21
Compare
I'm not exactly sure what exactly is missing from the tokenisation, but my tests that I added for the footnotes and the additional configuration I implemented are working as expected. 🤔
I believe I made a mistake there by hastily replacing the explicit
I'm afraid I cannot. The CommonMark spec does not contain any details on footnotes as it is considered a so called extension, however the specification fails to specify what the extensions are. That being said, we explicitly enable footnotes in Even though GHFM, GLFM, and even
Finally all checks are passing for my PR, however I'm still not completely satisfied with what I have here. The contribution guide (or the lack thereof) gives me no clue as to what to prefer: remain backwards compatible at all cost (this is what I did in this PR), or fix mistakes even if that alters the previous behaviour. Why does this matter? The former means the merge of the word and footnote reference has to be disabled explicitly, but the configuration option IMHO the latter feels like a better option to me, but I wanted to stay on the safe side first. Let me know your preference and if you decide that the former is the way to go, I'm open for suggestions as to how to call this option in the configuration. |
Hey, it depends on a case by case basis, I am also happy to just do a breaking change release. I agree that this is a common extension and should be supported without any headaches. Thank you for your contribution! I'll add a contributing guide some time next week~ish. |
What does this PR accomplish?
Changes proposed by this PR:
This PR introduces the option in the configuration to skip checking the footnote references, i.e. under
[Hunspell.quirks]
it introduces a new option, calledcheck_footnote_references
which is by default set totrue
for backwards compatibility and can be explicitly opted out by setting it tofalse
.As the doc-comment explains it, this is very useful when the markdown uses abbreviations as footnote references (akin to how one would use short link references) but unlike link references this is never skipped. Which results in the word the footnote had been applied to concatenated with the footnote reference itself, e.g.
Will result in checking for spelling against the segment
Helloabc
.📜 Checklist
./demo
sub directory