mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Merge pull request #3213 from GerwinvBeek/markdown-regex
Improved regex for markdown renderer
This commit is contained in:
commit
35f617e96c
@ -27,7 +27,7 @@ RED.utils = (function() {
|
|||||||
level: 'block', // Is this a block-level or inline-level tokenizer?
|
level: 'block', // Is this a block-level or inline-level tokenizer?
|
||||||
start(src) {
|
start(src) {
|
||||||
if (!src) { return null; }
|
if (!src) { return null; }
|
||||||
let m = src.match(/:[^:\n]/);
|
let m = src.match(/:[^:\n]/g);
|
||||||
return m && m.index; // Hint to Marked.js to stop and check for a match
|
return m && m.index; // Hint to Marked.js to stop and check for a match
|
||||||
},
|
},
|
||||||
tokenizer(src, tokens) {
|
tokenizer(src, tokens) {
|
||||||
@ -53,7 +53,7 @@ RED.utils = (function() {
|
|||||||
level: 'inline', // Is this a block-level or inline-level tokenizer?
|
level: 'inline', // Is this a block-level or inline-level tokenizer?
|
||||||
start(src) {
|
start(src) {
|
||||||
if (!src) { return null; }
|
if (!src) { return null; }
|
||||||
let m = src.match(/:/);
|
let m = src.match(/:/g);
|
||||||
return m && m.index; // Hint to Marked.js to stop and check for a match
|
return m && m.index; // Hint to Marked.js to stop and check for a match
|
||||||
},
|
},
|
||||||
tokenizer(src, tokens) {
|
tokenizer(src, tokens) {
|
||||||
|
Loading…
Reference in New Issue
Block a user