Skip to content

markdown: Allow inline-block styles on spans - #336133

Merged
Alexandru Dima (alexdima) merged 2 commits into
mainfrom
agents/markdown-renderer-merge-conflict-fix
Sep 14, 2026
Merged

Alexandru Dima (alexdima) merged 2 commits into
mainfrom
agents/markdown-renderer-merge-conflict-fix

Conversation

@alexdima

@alexdima Alexandru Dima (alexdima) commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

Summary

  • preserve display:inline-block on sanitized <span> elements
  • adapt the implementation from Allow display:inline-block on spans style #180498 to the current domSanitize sanitizer architecture
  • add focused coverage that preserves inline-block while stripping display:block

Attribution

This incorporates the original work from #180498 by Yoav Balasiano (@yoavbls). The exact original commit, 6a26c24dccf45de6b770297ed2c48e315de4682f, is retained in the branch history as a parent of the adaptation merge commit.

Testing

  • npm run compile
  • ./scripts/test.sh --run src/vs/base/test/browser/markdownRenderer.test.ts --grep "Only allows inline-block display style on spans"
  • pre-commit hygiene checks

Closes #180496

Preserve display:inline-block on sanitized span elements using the current sanitizer architecture, with focused regression coverage.

Co-authored-by: Copilot <[email protected]>
Copilot AI balanced review requested due to automatic review settings September 14, 2026 10:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The narrowly scoped sanitizer change matches the stated behavior and includes appropriate positive and negative coverage.

Review tier: Balanced
Findings: None

What changed in this PR

Allows sanitized Markdown <span> elements to retain the safe display:inline-block style.

Changes:

  • Adds display:inline-block to the style allowlist.
  • Tests preservation of inline-block and removal of block.
File Description
src/​vs/​base/​browser/​markdownRenderer.ts Extends span style sanitization.
src/​vs/​base/​test/​browser/​markdownRenderer.test.ts Adds focused sanitizer coverage.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@alexdima
Alexandru Dima (alexdima) marked this pull request as ready for review September 14, 2026 11:01
@alexdima
Alexandru Dima (alexdima) merged commit 301db87 into main Sep 14, 2026
35 checks passed
@alexdima
Alexandru Dima (alexdima) deleted the agents/markdown-renderer-merge-conflict-fix branch September 14, 2026 11:03
@vs-code-engineering vs-code-engineering Bot added this to the 1.139.0 milestone Sep 14, 2026
@yoavbls

Copy link
Copy Markdown
Contributor

Thank you so much Alexandru!
We have been waiting for so long ❤️

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow display prop on markdown span style

4 participants