1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-12-02 16:58:49 +09:00

Add block comment support

This commit is contained in:
syuilo 2017-02-09 23:03:16 +09:00
parent 427dd7af18
commit d548f128d9

View File

@ -101,6 +101,16 @@ const elements = [
};
},
// block comment
code => {
const match = code.match(/^\/\*([\s\S]+?)\*\//);
if (!match) return null;
return {
html: `<span class="comment">${escape(match[0])}</span>`,
next: match[0].length
};
},
// string
code => {
if (!/^['"`]/.test(code)) return null;