Fix pillification sometimes doubling up (#9152)
* Fix pillification sometimes doubling up * Remove redundant assignment * Add unit tests around pillification * Kill ts-ignore
This commit is contained in:
parent
147ec49ff5
commit
48ae16b5a5
2 changed files with 95 additions and 2 deletions
|
@ -44,8 +44,8 @@ export function pillifyLinks(nodes: ArrayLike<Element>, mxEvent: MatrixEvent, pi
|
|||
while (node) {
|
||||
let pillified = false;
|
||||
|
||||
if (node.tagName === "PRE" || node.tagName === "CODE") {
|
||||
// Skip code blocks
|
||||
if (node.tagName === "PRE" || node.tagName === "CODE" || pills.includes(node)) {
|
||||
// Skip code blocks and existing pills
|
||||
node = node.nextSibling as Element;
|
||||
continue;
|
||||
} else if (node.tagName === "A" && node.getAttribute("href")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue