+ support

This commit is contained in:
syuilo 2017-02-09 20:47:54 +09:00
parent 667f6ca335
commit 869b7d7078

View File

@ -172,8 +172,8 @@ const elements = [
(code, i, source) => { (code, i, source) => {
const prev = source[i - 1]; const prev = source[i - 1];
if (prev && /[a-zA-Z]/.test(prev)) return null; if (prev && /[a-zA-Z]/.test(prev)) return null;
if (!/^\-?[0-9]+/.test(code)) return null; if (!/^[\-\+]?[0-9]+/.test(code)) return null;
const match = code.match(/^\-?[0-9-]+/)[0]; const match = code.match(/^[\-\+]?[0-9-]+/)[0];
if (match) { if (match) {
return { return {
html: `<span class="number">${match}</span>`, html: `<span class="number">${match}</span>`,