Skip to content

Text color does not affect underline #7299

@Clindbergh

Description

@Clindbergh

Affected Packages

core, static-renderer

Version(s)

3.12

Bug Description

Adding a color to an underlined text does not change the color of the underline. This is because the underline is rendered outside.

See the failing test case (PR).

 FAIL  packages/static-renderer/__tests__/json-string.spec.ts > static render json to string (with prosemirror) > supports underline and spans
AssertionError: expected '<p><u><span style="color: #ED1F1F">Un…' to be '<p><span style="color: #ED1F1F"><u>Un…' // Object.is equality

Expected: "<p><span style="color: #ED1F1F"><u>Underlined</u></span></p>"
Received: "<p><u><span style="color: #ED1F1F">Underlined</span></u></p>"

 ❯ packages/static-renderer/__tests__/json-string.spec.ts:293:18
    291|     })
    292| 
    293|     expect(html).toBe('<p><span style="color: #ED1F1F"><u>Underlined</u></span></p>')
       |                  ^
    294|   })
    295| 

Browser Used

Chrome

Code Example URL

No response

Expected Behavior

The underline is rendered outside.

Additional Context (Optional)

No response

Dependency Updates

  • Yes, I've updated all my dependencies.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Open SourceThe issue or pull reuqest is related to the open source packages of Tiptap.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions