mirror of https://github.com/fantasticit/think.git
tiptap: add list judge
This commit is contained in:
parent
6abd21545c
commit
2e991f0a79
|
@ -3,6 +3,12 @@ export const isMarkdown = (text: string): boolean => {
|
||||||
const html = text.match(/<\/?[a-z][\s\S]*>/i);
|
const html = text.match(/<\/?[a-z][\s\S]*>/i);
|
||||||
if (html && html.length) return true;
|
if (html && html.length) return true;
|
||||||
|
|
||||||
|
// 无序列表
|
||||||
|
if (/^[*|+|-]/.test(text)) return true;
|
||||||
|
|
||||||
|
// 有序列表
|
||||||
|
if (/^[0-9]+\)/.test(text)) return true;
|
||||||
|
|
||||||
// image
|
// image
|
||||||
const image = text.match(/!\[(\s|.)?\]\((\s|.)?\)/);
|
const image = text.match(/!\[(\s|.)?\]\((\s|.)?\)/);
|
||||||
if (image && image.length) return true;
|
if (image && image.length) return true;
|
||||||
|
|
Loading…
Reference in New Issue