Add language prefixes for inline code - #1
Merged
Merged
Conversation
This was referenced Jul 13, 2026
samuel-williams-shopify
force-pushed
the
inline-code-info
branch
from
August 20, 2026 03:06
2acf736 to
b2567b0
Compare
samuel-williams-shopify
force-pushed
the
main
branch
from
August 20, 2026 04:32
ede48b0 to
5fd7e89
Compare
Assisted-By: devx/c76f68ef-c5ab-4096-b170-fc6974ad760d
Assisted-By: devx/c76f68ef-c5ab-4096-b170-fc6974ad760d
Assisted-By: devx/c76f68ef-c5ab-4096-b170-fc6974ad760d
Assisted-By: devx/c76f68ef-c5ab-4096-b170-fc6974ad760d
samuel-williams-shopify
force-pushed
the
inline-code-info
branch
from
August 20, 2026 04:39
2aaa342 to
51bb37b
Compare
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.
Summary
This adds opt-in language annotations for inline code spans through
CMARK_OPT_INLINE_CODE_INFOand the CLI flag--inline-code-info.With the option enabled, this renders as:
Without the option, the language prefix remains literal text:
Language identifiers begin with an alphanumeric character and may additionally contain
_,-,+,#, and.. Examples includec++,c#,objective-c, andruby_template.Behavior
Use `x`: then continue.class="language-..."; XML output exposes the language in theinfoattribute._,-, or..API
cmark_node_get_code_infoandcmark_node_set_code_infofor code blocks and inline code spans.cmark_node_get_fence_infoandcmark_node_set_fence_infobehavior remains restricted to code blocks and front matter.CMARK_OPT_INLINE_CODE_INFOis selected.Validation
Passing:
The complete test suite retains four failures already present on the base branch: two standalone inline-node newline assertions and the
<m:abc>autolink expectation in three test variants.