mirror of
https://github.com/outline/outline.git
synced 2026-11-21 05:24:03 +03:00
More improvements to LaTeX fence detection
This commit is contained in:
1 parent
48cae96a56
commit
5d09be4add
2 files changed
+8
-3
No files matched your search
@@ -36,7 +36,12 @@ this is code
|
||||
});
|
||||
|
||||
test("returns true for latex fence", () => {
|
||||
expect(isMarkdown(`\$\$i\$\$`)).toBe(true);
|
||||
expect(isMarkdown(`\$i\$`)).toBe(true);
|
||||
expect(
|
||||
isMarkdown(`\$0.00
|
||||
random content
|
||||
\$1.00`)
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
test("returns false for non-closed fence", () => {
|
||||
|
||||
@@ -10,8 +10,8 @@ export default function isMarkdown(text: string): boolean {
|
||||
}
|
||||
|
||||
// latex-ish
|
||||
const latex = text.match(/\$\$/gm);
|
||||
if (latex && latex.length > 1) {
|
||||
const latex = text.match(/\$(.+)\$/g);
|
||||
if (latex && latex.length > 0) {
|
||||
signals += latex.length;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user