Fix pills being broken by unescaped characters
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
36fea4d487
commit
95eaf94cd8
4 changed files with 30 additions and 2 deletions
|
@ -50,7 +50,7 @@ function parseLink(a, partCreator) {
|
|||
if (href === a.textContent) {
|
||||
return partCreator.plain(a.textContent);
|
||||
} else {
|
||||
return partCreator.plain(`[${a.textContent}](${href})`);
|
||||
return partCreator.plain(`[${a.textContent.replace(/[\\\]]/, c => "\\" + c)}](${href})`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ export function mdSerialize(model) {
|
|||
return html + part.text;
|
||||
case "room-pill":
|
||||
case "user-pill":
|
||||
return html + `[${part.text}](${makeGenericPermalink(part.resourceId)})`;
|
||||
return html + `[${part.text.replace(/[\\\]]/, c => "\\" + c)}](${makeGenericPermalink(part.resourceId)})`;
|
||||
}
|
||||
}, "");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue