We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 4863648 + 926f56c commit 96c99f7Copy full SHA for 96c99f7
src/_11ty/plugins/highlight.js
@@ -46,6 +46,12 @@ export async function configureHighlighting(markdown) {
46
const token = tokens[index];
47
48
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
55
const language = splitTokenInfo.length > 1 ? splitTokenInfo[1] : '';
56
const attributes = splitTokenInfo.length > 2 ? splitTokenInfo[2] : '';
57
0 commit comments