#123
Not supported in labels: `<s>`, `<del>` and `<strike>`
Description
Pele drops <s>, <del> and <strike> in labels and draws their
text plain. It already draws <u> and <ins> as underlined. Docs
often use strikethrough to show what was removed or replaced, so the
meaning is lost.
Steps to reproduce
Render this diagram with render():
flowchart LR
A["<s>old</s> new"] --> B["<u>under</u> and <del>gone</del>"]Expected
"old" and "gone" have a line through them. Mermaid 12.3.0 draws
labels as HTML, and the browser draws all three tags with
text-decoration-line: line-through.
Actual
Node A is plain text. Node B keeps its underline but loses the strikethrough:
<!-- node A -->
<text class="pele-label" x="0" y="5.6" text-anchor="middle">
old new
</text>
<!-- node B -->
<text class="pele-label" text-anchor="middle" xml:space="preserve">
<tspan x="0" y="5.6" text-decoration="underline">under</tspan>
<tspan> and gone</tspan>
</text>| Mermaid 12.3.0 | Pele 1.13.0 |
|---|---|
Environment
- pele 1.13.0 (npm)
- Mermaid 12.3.0 for comparison
Possible fix
The underline path has all the pieces:
TAG_STYLESin src/text/label.ts mapsuandinstoStyle.Underline.s,delandstrikecould map to a newStyle.Strike.spanStyle()in src/svg/builder.ts writestext-decoration="underline". It could writeline-through, orunderline line-throughfor a span with both.textBlock()in src/diagrams/kanban/render.ts has a single-span fast path that skipsStyle.Underline. It needs to skipStyle.Striketoo, or kanban cards lose the line.
Widths don't change, because a line through the text takes no room. I have a patch and can open a PR.
Activity
0No activity yet.