You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The integration tests ensure plugins work together correctly, while the e2e tests ensure the final output is accessible and semantically correct for users.
@@ -56,46 +72,65 @@ Working plugins that pass all tests:
56
72
- rehype-autolink-headings
57
73
- rehype-tailwind-classes
58
74
75
+
Conditional elements (have checks):
76
+
77
+
- a (checks for .btn and .heading-anchor)
78
+
- code (checks if within pre)
79
+
- h2/h3/h4
80
+
- blockquote (attribution check)
81
+
- pre
82
+
- iframe
83
+
- various special cases
84
+
59
85
## Markdown Config Updates
60
86
87
+
Details/Summary elements - These HTML elements aren't being processed by remarkGfm (they need to be raw HTML)
88
+
89
+
Inline code - The test shows inline code is working (it has the proper classes), but the assertion was looking for just <code> instead of the full classes
90
+
91
+
/** Add ==highlighted== syntax */
92
+
93
+
1. add remark-mark plugin
94
+
2. Remove skip from integration test in
95
+
61
96
/**
62
97
* Add accessible name to section in footnotes plugin
* Mark external, absolute links with appropriate rel & target attributes
114
149
*/
115
-
// const markdownExternalAnchorConfig = {
116
-
/** The domain that is considered an internal link */
117
-
// domain: domain,
118
-
/** A class name added to anchors */
119
-
// class: 'external-link',
120
-
// }
150
+
// const markdownExternalAnchorConfig = {
151
+
/** The domain that is considered an internal link */
152
+
// domain: domain,
153
+
/** A class name added to anchors */
154
+
// class: 'external-link',
155
+
// }
121
156
122
157
/** es, GFM footnotes are supported in Astro, and they are enabled by using the remark-gfm plugin. This plugin allows you to use the standard footnote syntax, where you define a footnote reference inline (e.g., [^1]) and the footnote content at the bottom of the document (e.g., [^1]: This is my footnote). */
* Mermaid JavaScript based diagramming and charting tool
152
187
*/
153
-
/*const markdownMermaidConfig = {
154
-
startOnLoad: false,
155
-
securityLevel: true,
156
-
theme: 'default',
157
-
flowchart: {
188
+
/*const markdownMermaidConfig = {
189
+
startOnLoad: false,
190
+
securityLevel: true,
191
+
theme: 'default',
192
+
flowchart: {
158
193
htmlLabels: false,
159
194
useMaxWidth: true,
160
-
},
161
-
dictionary: {
195
+
},
196
+
dictionary: {
162
197
token: 'mermaid',
163
198
graph: 'graph',
164
199
sequenceDiagram: 'sequenceDiagram',
165
-
},
166
-
// ...or any other options
167
-
}*/
168
-
markdown.syntaxHighlight.excludeLangs
169
-
Type:Array<string>
170
-
Default: ['math']
200
+
},
201
+
// ...or any other options
202
+
}*/
203
+
markdown.syntaxHighlight.excludeLangs
204
+
Type:Array<string>
205
+
Default: ['math']
171
206
172
207
Added in: astro@5.5.0
173
208
An array of languages to exclude from the default syntax highlighting specified inmarkdown.syntaxHighlight.type. This can be useful when using tools that create diagrams from Markdown code blocks, such as Mermaid.js and D2.
remark-math: A Remark plugin that parses LaTeX syntax within your Markdown files.
217
-
rehype-katex or rehype-mathjax: Rehype plugins that convert the parsed LaTeX into rendered HTML using either KaTeX or MathJax, respectively. KaTeX is often preferred for its performance and ability to allow text selection.
remark-math: A Remark plugin that parses LaTeX syntax within your Markdown files.
252
+
rehype-katex or rehype-mathjax: Rehype plugins that convert the parsed LaTeX into rendered HTML using either KaTeX or MathJax, respectively. KaTeX is often preferred for its performance and ability to allow text selection.
253
+
To implement this:
254
+
Install the necessary packages.
255
+
Code
221
256
222
257
npm install remark-math rehype-katex katex
223
-
(or rehype-mathjax if you prefer MathJax).
224
-
Configure Astro: In your astro.config.mjs (or astro.config.ts), add remarkMath and rehypeKatex to your Markdown configuration:
225
-
*/
258
+
(or rehype-mathjax if you prefer MathJax).
259
+
Configure Astro: In your astro.config.mjs (or astro.config.ts), add remarkMath and rehypeKatex to your Markdown configuration:
260
+
*/
226
261
227
262
/** Adds underline to markdown like _underline_ */
228
263
// @TODO: conflicts with built-in markup for italics: _italics_ _underline_, change one
@@ -310,12 +345,20 @@ export function myAccessibleListPlugin() {
0 commit comments