Fix meta shortcode truncating multi-word values in raw HTML contexts#14160
Merged
Fix meta shortcode truncating multi-word values in raw HTML contexts#14160
Conversation
Collaborator
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
Collaborator
|
The service we use to get placeholder images seems to be failing. Another thing to replace with our own... |
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.
When
{{< meta key >}}appears in raw HTML contexts (include-after-body text blocks, raw HTML blocks), multi-word values are truncated to the first word."Release Candidate"becomes"Release".Root Cause
Shortcodes in raw text (RawBlock, CodeBlock, include text) are resolved by an lpeg parser that calls the handler with
context = "text"and then stringifies the result (customnodes/shortcodes.lua:247-248). Thetextbranch added by #14073 checked#optionValue > 0to handle single pandoc-native Str nodes, but this matched any non-empty Inlines list. For[Str("Release"), Space, Str("Candidate")], onlyoptionValue[1].textwas returned.Fix
Narrow the guard to
#optionValue == 1(exact single-Str match) and add an Inlines branch usingpandoc.utils.stringify()which concatenates all inline elements. The Blocks path (pandoc.write(markdown)) is unchanged, preserving #14061 line-break behavior.Fixes #14159