Skip to content

Keep the Emoticons plugin out of HTML tags and comments - #290

Merged
mraible merged 1 commit into
apache:masterfrom
mraible:smileys-outside-tags
Nov 16, 2026
Merged

mraible merged 1 commit into
apache:masterfrom
mraible:smileys-outside-tags

Conversation

@mraible

@mraible mraible commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

The Emoticons plugin replaced emoticons anywhere in an entry's HTML, including inside tags. On a copy of raibledesigns.com, nine posts with Instagram embeds have an SVG with xmlns:xlink=..., and its :x became an emoji, breaking the markup. Roller 5 broke the same spot with a GIF, so this isn't a regression from #266, but it's still wrong.

  • SmileysPlugin's single-pass pattern now also matches an HTML comment or tag (< followed by a letter, / or !, up to >) and copies it unchanged, so only text between tags is replaced.
  • A plain < in text, as in 1 < 2 :-), isn't treated as a tag, so the emoticon after it still converts.
  • SmileysPluginTest covers the SVG case, an attribute holding :-), a comment, and the < case; the SVG test fails without the fix.
  • CHANGES.md gets a line under the fixes found while upgrading a 6.1 site.

The plugin replaced emoticons anywhere in an entry, so the :x in xmlns:xlink inside an embedded SVG became an emoji. The single-pass pattern now also matches tags and comments and copies them unchanged.
@mraible
mraible requested a review from snoopdave November 16, 2026 01:24

@snoopdave snoopdave 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.

LGTM 😀

@mraible
mraible merged commit 99f80cc into apache:master Nov 16, 2026
9 checks passed
@mraible
mraible deleted the smileys-outside-tags branch November 16, 2026 01:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants