Repository navigation
Conversation
--no-code-tag-removal flag--no-code-tag-removal flag
ekalinin
requested changes
Oct 15, 2026
ekalinin
left a comment
Owner
There was a problem hiding this comment.
Thanks for the PR. A few things need to be fixed before it can be merged:
- Conflicts with master. Since this PR,
--depth(#174) and--numbered(#177) took the same argument slots:$8/$9ingh_tocand$3/$4ingh_toc_grab. Please rebase onto current master and move the flag to the next free slots. Watch out forlocal no_code_tag_removal=$3ingh_toc_grab: it merges without a conflict, and since tags are only removed when the value is exactly"no", master'sdepth=0there turns backticks on for everyone. Checking for"yes"instead would keep the default safe. Also, the blank line added intests.batsconflicts with the "TOC for remote README.md" test, which is re-enabled on master, so please keep master's side there. - The flag doesn't work with stdin. It's parsed after the
-branch returns, sogh-md-toc - --no-code-tag-removalsilently strips the backticks, andgh-md-toc --no-code-tag-removal -treats-as a file name (it prints the file header and footer andrm: illegal option -- ~). Parsing it together with--indent/--depth/--numbered, before the-check, would fix it. Please add a stdin test too. - HTML entities end up inside the backticks. GitHub renders
`a<b>`as<code>a<b></code>, so the entry becomes[The `a<b>` case]. Entities aren't decoded inside code spans, so GitHub showsa<b>literally, while without the flag the same heading displays correctly. The entities need to be decoded when converting to backticks. - Code that contains backticks breaks. Every
<code>becomes a single backtick, so``foo `bar` baz``turns into`foo `bar` baz`, which is two code spans with a barebarbetween them. The fence has to be longer than the longest run of backticks inside the code.
Contributor
Author
Do you have a proposal for how to implement this? The list of entities is huge and implementing this ourselves would be unfeasible. There are options available, but I'm not sure if adding a dependency for this is something you are willing to do / if you are, what dependency to choose. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #153.