fix(block-editor): render subscript and superscript marks as <sub>/<sup> in Story Block HTML output#35506
Open
dsolistorres wants to merge 3 commits intomainfrom
Open
fix(block-editor): render subscript and superscript marks as <sub>/<sup> in Story Block HTML output#35506dsolistorres wants to merge 3 commits intomainfrom
dsolistorres wants to merge 3 commits intomainfrom
Conversation
Contributor
|
Claude finished @dsolistorres's task in 1m 32s —— View job dotCMS Backend Review
All four sub-reviews (security, database, Java standards, REST API) returned no issues. ✅ dotCMS Backend Review: no issues found. |
Contributor
|
✅ dotCMS Backend Review: no issues found. |
934aa7a to
3720a9b
Compare
…up> in Story Block HTML output The renderMarks macro in VM_global_library.vm handled bold, italic, strike, underline, and link marks but silently dropped subscript and superscript marks even though the Block Editor (TipTap) registers both extensions and authors can produce them. Adds the two missing branches in both the opening and closing reverse-range loops so nested combinations (e.g. bold + superscript) close in the correct order, plus an integration test in StoryBlockMapTest covering each mark individually and a combined nesting case. Closes #35460 Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
Add subscript and superscript handling to the inline MACRO constant so the test file reflects the real renderMarks macro in VM_global_library.vm. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
The inline MACRO registered in @before pads tags with newlines and indent, so contains-checks for contiguous wrappings like <sup>sup</sup> never match even when the macro is correct. Strip whitespace before asserting so the test still verifies the wrapping order and nesting. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
8f21330 to
bc0ddc7
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
subscriptandsuperscriptmark handling to therenderMarksmacro indotCMS/src/main/webapp/WEB-INF/velocity/VM_global_library.vm— previously these marks were silently dropped during Story Block HTML rendering even though the Block Editor (TipTap) registers both extensions.bold+superscript) close in the correct order.StoryBlockMapTest(test_subscript_and_superscript_marks_render_to_html) covering each mark individually plus a combined nesting case (<strong><sup>bold-sup</sup></strong>).Closes #35460
Before / After
Input JSON:
{ "type": "text", "marks": [{ "type": "superscript" }], "text": "2" }2<sup>2</sup>Test plan
./mvnw verify -pl :dotcms-integration -Dcoreit.test.skip=false -Dit.test=StoryBlockMapTestpasses (new test + existing tests).$contentlet.myField.toHtmlin a VTL/page, confirm<sub>/<sup>wrap the affected text.bold,italic,strike,underline, andlinkstill render as before.🤖 Generated with Claude Code