tcmd: italic

This commit is contained in:
2024-02-29 02:15:11 -07:00
parent 2e8ddd8ed2
commit 18f8541de7
4 changed files with 20 additions and 3 deletions

View File

@@ -76,6 +76,21 @@ export const inlineTokens: {
return l.replace(this.rx, (_, __, val) => val);
},
},
{
rx: /(?<!\*)\*([^\*]+?)\*(?!\*)/g,
create(content, start, end, tokens) {
tokens.push({
content: this.replace(content[0]),
type: "italic",
end,
start,
uuid: crypto.randomUUID(),
});
},
replace(l) {
return l.replace(this.rx, (...all) => all[1]);
},
},
{
rx: /(?<![\!\?|^])\[(.*?)\]\((.*?)\)/g,
create(content, start, end, tokens) {