1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-11-30 07:49:02 +09:00

負の数サポート

This commit is contained in:
syuilo 2017-02-09 20:32:45 +09:00
parent e160b81476
commit 22195a7a06

View File

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