Skip to content

Commit 086e5c3

Browse files
committed
fix
1 parent 87c31b9 commit 086e5c3

File tree

4 files changed

+29
-22
lines changed

4 files changed

+29
-22
lines changed

deno.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"marked-footnote": "npm:marked-footnote@^1.2",
1111
"marked-gfm-heading-id": "npm:marked-gfm-heading-id@^3.1",
1212
"prismjs": "npm:prismjs@^1.29",
13+
"prismjs-yaml": "npm:prismjs@^1.29/components/prism-yaml.js",
1314
"sanitize-html": "npm:sanitize-html@^2.11",
1415
"he": "npm:he@^1.2",
1516
"katex": "npm:katex@^0.16",
@@ -29,6 +30,11 @@
2930
"test": "deno test --allow-read --allow-env --allow-write --allow-run --allow-net"
3031
},
3132
"fmt": {
32-
"exclude": ["./test/fixtures/alerts.md", "./test/fixtures/lineBreaks.md"]
33+
"exclude": [
34+
"./test/fixtures/alerts.md",
35+
"./test/fixtures/lineBreaks.md",
36+
"./test/fixtures/footnote.md",
37+
"./example/content.md"
38+
]
3339
}
3440
}

example/content.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@ G_{\mu v} = \frac{8 \pi G}{c^4} T_{\mu v}
7070

7171
We also support math blocks and inline math blocks as well!
7272

73-
When $a \ne 0$, there are two solutions to $(ax^2 + bx + c = 0)$and they are
73+
When $a \ne 0$, there are two solutions to $(ax^2 + bx + c = 0)$ and they are
7474

7575
$$ x = {-b \pm \sqrt{b^2-4ac} \over 2a} $$
7676

77-
You can even typeset individual letters or whole sentences inline just like
78-
$x$or $Quadratic \; formula$. You can also use math blocks to typeset whole
77+
You can even typeset individual letters or whole sentences inline just like $x$
78+
or $Quadratic \; formula$. You can also use math blocks to typeset whole
7979
equations with $\LaTeX$:
8080

8181
$$ \begin{aligned} \dot{x} & = \sigma(y-x) \\ \dot{y} & = \rho x - y - xz \\

mod.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import markedFootnote from "marked-footnote";
88
import { gfmHeadingId } from "marked-gfm-heading-id";
99
import Prism from "prismjs";
1010
import sanitizeHtml from "sanitize-html";
11+
import "prismjs-yaml";
1112

12-
import "https://esm.sh/[email protected]/components/prism-yaml";
1313
import { CSS, KATEX_CLASSES, KATEX_CSS } from "./style.ts";
1414
export { CSS, KATEX_CSS, Marked };
1515

@@ -54,12 +54,12 @@ export class Renderer extends Marked.Renderer {
5454
if (isTitleIncluded) {
5555
language = language!.split(" ")[0];
5656
title = isTitleIncluded[1];
57-
} else {
58-
// a language of `ts, ignore` should really be `ts`
59-
// and it should be lowercase to ensure it has parity with regular github markdown
60-
language = language?.split(",")?.[0].toLocaleLowerCase();
6157
}
6258

59+
// a language of `ts, ignore` should really be `ts`
60+
// and it should be lowercase to ensure it has parity with regular github markdown
61+
language = language?.split(",")?.[0].toLocaleLowerCase();
62+
6363
// transform math code blocks into HTML+MathML
6464
// https://github.blog/changelog/2022-06-28-fenced-block-syntax-for-mathematical-expressions/
6565
if (language === "math" && this.allowMath) {

test/fixtures/footnote.md

+14-13
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,24 @@ blocks[^bignote].
2222

2323
[^bignote]: The first paragraph of the definition.
2424

25-
Paragraph two of the definition.
25+
Paragraph two of the definition.
2626

27-
> A blockquote with multiple lines.
27+
> A blockquote with
28+
> multiple lines.
2829
29-
```
30-
a code block
31-
```
30+
~~~
31+
a code block
32+
~~~
3233
33-
| Header 1 | Header 2 |
34-
| -------- | -------- |
35-
| Cell 1 | Cell 2 |
34+
| Header 1 | Header 2 |
35+
| -------- | -------- |
36+
| Cell 1 | Cell 2 |
3637
37-
A \`final\` paragraph before list.
38+
A \`final\` paragraph before list.
3839
39-
- Item 1
40-
- Item 2
41-
- Subitem 1
42-
- Subitem 2
40+
- Item 1
41+
- Item 2
42+
- Subitem 1
43+
- Subitem 2
4344
4445
[^@#$%]: A footnote on the label: "@#$%".

0 commit comments

Comments
 (0)