Skip to content

Xhtml5BaseSink may emit invalid attributes for Sink.inline() when passing multiple attributes #1034

Closed

Description

@kwin

Affected version

2.0.0

Bug description

With the following Sink method calls

SinkEventAttributeSet attributes = new SinkEventAttributeSet();
// set different attributes (semantic, style and decoration)
attributes.addAttributes(SinkEventAttributeSet.LINETHROUGH);
attributes.addAttributes(SinkEventAttributeSet.BOLD);
attributes.addAttributes(Semantics.SUPERSCRIPT);
sink.inline(attributes);
sink.text("text");
sink.inline_();

the Xhtml5BaseSink emits invalid HTML5:

<sup decoration="line-through" style="bold">text</sup>

decoration is not supported as attribute in HTML5 at all and style (although supported) must not have value bold.

Activity

  1. added
    bugSomething isn't working
    on Feb 16, 2026
  2. kwin commented on Feb 16, 2026

    @kwin
    MemberAuthor

    The culprit is

    which just emits all non Semantic attributes as is. IMHO the ones not valid as HTML5 attributes from
    static {
    UNDERLINE = new SinkEventAttributeSet(DECORATION, "underline").unmodifiable();
    OVERLINE = new SinkEventAttributeSet(DECORATION, "overline").unmodifiable();
    LINETHROUGH = new SinkEventAttributeSet(DECORATION, "line-through").unmodifiable();
    SOURCE = new SinkEventAttributeSet(DECORATION, "source").unmodifiable();
    BOLD = new SinkEventAttributeSet(STYLE, "bold").unmodifiable();
    ITALIC = new SinkEventAttributeSet(STYLE, "italic").unmodifiable();
    MONOSPACED = new SinkEventAttributeSet(STYLE, "monospaced").unmodifiable();
    LEFT = new SinkEventAttributeSet(ALIGN, "left").unmodifiable();
    RIGHT = new SinkEventAttributeSet(ALIGN, "right").unmodifiable();
    CENTER = new SinkEventAttributeSet(ALIGN, "center").unmodifiable();
    JUSTIFY = new SinkEventAttributeSet(ALIGN, "justify").unmodifiable();
    }
    should be converted to supported semantic attributes or supported inline elements first.

    @michael-o WDYT?

  3. added a commit that references this issue on Mar 19, 2026
    5722f35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions