いい感じにやった

This commit is contained in:
syuilo 2017-02-10 00:40:34 +09:00
parent 8c9ae6e8cf
commit 76e2892949
6 changed files with 53 additions and 35 deletions

View file

@ -188,6 +188,16 @@ const elements = [
};
},
// label
code => {
if (code[0] != '@') return null;
const label = code.match(/^@([a-zA-Z_-]+?)\n/)[0];
return {
html: `<span class="label">${label}</span>`,
next: label.length
};
},
// extract vars
(code, i, source, vars) => {
const prev = source[i - 1];