asciidoctor-extensions: fix synopsis parser dropping leading single quotes#2157
Open
ZhongRuoyu wants to merge 1 commit intogit:gh-pagesfrom
Open
asciidoctor-extensions: fix synopsis parser dropping leading single quotes#2157ZhongRuoyu wants to merge 1 commit intogit:gh-pagesfrom
ZhongRuoyu wants to merge 1 commit intogit:gh-pagesfrom
Conversation
…uotes The `ignore` rule in AdocSynopsisQuote strips both backticks and single quotes, but the `keyword` rule treats single quotes as part of keywords. Therefore, the parser drops leading single quotes that appear first in a token, and preserves those at the end of a token, which is not intended nor consistent. This results in missing single quotes in some places, including but not limited to: - https://git-scm.com/docs/git#Documentation/git.txt-GITLITERALPATHSPECS - https://git-scm.com/docs/git-branch#Documentation/git-branch.txt--l - https://git-scm.com/docs/git-config#Documentation/git-config.txt-corealternateRefsCommand Single quotes are legitimate shell-quoting characters, so only backticks should be ignored. With this change, since single quotes are already in the keyword character class, they now pass through correctly as part of keyword tokens. Fixes missing leading single quotes in various documentation pages, including the following and their versioned counterparts: external/docs/content/docs/CodingGuidelines.html | 2 +- external/docs/content/docs/api-parse-options.html | 2 +- external/docs/content/docs/git-branch.html | 2 +- external/docs/content/docs/git-cat-file.html | 2 +- external/docs/content/docs/git-config.html | 2 +- external/docs/content/docs/git-diff-tree.html | 4 ++-- external/docs/content/docs/git-format-patch.html | 2 +- external/docs/content/docs/git-grep.html | 2 +- external/docs/content/docs/git-log.html | 6 +++--- external/docs/content/docs/git-ls-tree.html | 2 +- external/docs/content/docs/git-push.html | 2 +- external/docs/content/docs/git-rev-list.html | 6 +++--- external/docs/content/docs/git-rm.html | 2 +- external/docs/content/docs/git-show.html | 4 ++-- external/docs/content/docs/git-tag.html | 2 +- external/docs/content/docs/git.html | 2 +- external/docs/content/docs/pretty-formats.html | 4 ++-- external/docs/content/docs/reftable.html | 6 +++--- Signed-off-by: Ruoyu Zhong <zhongruoyu@outlook.com>
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.
Changes
Context
The
ignorerule in AdocSynopsisQuote strips both backticks and single quotes, but thekeywordrule treats single quotes as part of keywords. Therefore, the parser drops leading single quotes that appear first in a token, and preserves those at the end of a token, which is not intended nor consistent. This results in missing single quotes in some places, including but not limited to:Single quotes are legitimate shell-quoting characters, so only backticks should be ignored. With this change, since single quotes are already in the keyword character class, they now pass through correctly as part of keyword tokens.
Fixes missing leading single quotes in various documentation pages, including the following and their versioned counterparts:
CC @jnavila (author of #1921)