mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-27 17:23:08 +02:00
負の数サポート
This commit is contained in:
parent
e160b81476
commit
22195a7a06
1 changed files with 2 additions and 2 deletions
|
@ -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>`,
|
||||||
|
|
Loading…
Reference in a new issue