Skip to content

Commit 96c99f7

Browse files
authored
Merge branch 'main' into fix-3729
2 parents 4863648 + 926f56c commit 96c99f7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/_11ty/plugins/highlight.js

+6
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ export async function configureHighlighting(markdown) {
4646
const token = tokens[index];
4747

4848
const splitTokenInfo = token.info.match(/(\S+)\s?(.*?)$/m);
49+
50+
if (!splitTokenInfo) {
51+
throw new Error('Each Markdown code block should specify a language ' +
52+
'after the opening backticks like: ```dart.');
53+
}
54+
4955
const language = splitTokenInfo.length > 1 ? splitTokenInfo[1] : '';
5056
const attributes = splitTokenInfo.length > 2 ? splitTokenInfo[2] : '';
5157

0 commit comments

Comments
 (0)