fix: preserve literal < and > in playlist script output - #1343
Open
mvanhorn wants to merge 1 commit into
Open
Conversation
The rich-text formatting pass treated any <...> sequence as a format tag, so unrecognised angle-bracket content (e.g. a title like <3 or a > b) was consumed and dropped instead of rendered. formatBlock() now only enters tag-processing for a recognised formatter whose name directly follows '<' and which closes with '>'; otherwise it emits the original <...> text verbatim. Fixes fooyin#1224
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
Literal
<and>characters now display in the playlist instead of being silently dropped. A title like<3ora > brenders as written, with no need for the\<escape workaround.Why this matters
The playlist runs script output through a second formatting pass, and
ScriptFormattertreated every<...>sequence as a formatting tag (issue #1224). Unrecognised angle-bracket content was consumed and discarded. Insrc/gui/scripting/scriptformatter.cpp,formatBlock()now only enters tag processing when the text after<is a recognised formatter (viaScriptFormatterRegistry::isKnown) that closes with>; otherwise it emits the original<...>text verbatim.readTagContent()stops at a nested<so a literal<cannot swallow a following real tag, and angle detection checks the token value so the scanner keywordsLESS/GREATERare not mistaken for bracket characters. Known tags with bad options still fall through toprocessFormat()and render their inner text.Testing
Added cases to
tests/gui/scriptformattertest.cppcovering literal brackets with spaces (a < b > c),I <3 this, an unknown tag kept literal (<notatag>rest), literal text mixed with real formatting (I <3 <b>this</b>and<b>I <3 this</b>), and the keyword words (<LESS>,5 LESS than 6). Existing bold/italic/colour/link tests continue to assert no regression. The Qt6 toolchain is not installed in this environment, so the suite was not run here; clang-format passes on both files.Fixes #1224