Commit 93cc16d
committed
Squashed commit of the following:
commit 75d7f1d
Author: Alan Guo Xiang Tan <gxtan1990@gmail.com>
Date: Mon Jan 19 13:45:11 2026 +0800
DEV: Add backward compatibility for tag object arrays (discourse#47)
What is the problem?
Discourse core PR #36678 changes `renderTag` to pass tag objects
instead of strings to custom tag renderers. This breaks the
`iconTagRenderer` function which expects the `tag` parameter to be
a string and calls `escapeExpression(tag)` directly.
What is the solution?
Extract the tag name at the start of `iconTagRenderer` using
`typeof tag === "string" ? tag : tag.name` before processing.
Also rename the local `tagName` variable to `htmlTagName` to avoid
confusion with the extracted tag name. This ensures backward
compatibility with both the old string format and the new object format.1 parent b3cea12 commit 93cc16d
2 files changed
Lines changed: 53 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
0 commit comments