tcmd: image element, heading links
This commit is contained in:
@@ -24,7 +24,7 @@ export const inlineTokens: {
|
||||
},
|
||||
},
|
||||
{
|
||||
rx: /\[(.*?)\]\((.*?)\)/g,
|
||||
rx: /(?<!\!)\[(.*?)\]\((.*?)\)/g,
|
||||
create(content, start, end, tokens) {
|
||||
const [_, label, href] = content;
|
||||
tokens.push({
|
||||
@@ -42,4 +42,22 @@ export const inlineTokens: {
|
||||
// return l
|
||||
},
|
||||
},
|
||||
{
|
||||
rx: /!\[(.*?)\]\((.*?)\)/g,
|
||||
create(content, start, end, tokens) {
|
||||
const [_, alt, src] = content;
|
||||
tokens.push({
|
||||
content: alt,
|
||||
end,
|
||||
start,
|
||||
type: "image",
|
||||
data: {
|
||||
src,
|
||||
},
|
||||
});
|
||||
},
|
||||
replace(l) {
|
||||
return l;
|
||||
},
|
||||
},
|
||||
];
|
||||
|
Reference in New Issue
Block a user