We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
lang
code
1 parent 72b8a68 commit 6fc783aCopy full SHA for 6fc783a
lib/handlers/code.js
@@ -20,14 +20,11 @@
20
*/
21
export function code(state, node) {
22
const value = node.value ? node.value + '\n' : ''
23
- // To do: next major, use `node.lang` w/o regex, the splitting’s been going
24
- // on for years in remark now.
25
- const lang = node.lang ? node.lang.match(/^[^ \t]+(?=[ \t]|$)/) : undefined
26
/** @type {Properties} */
27
const properties = {}
28
29
- if (lang) {
30
- properties.className = ['language-' + lang]
+ if (node.lang) {
+ properties.className = ['language-' + node.lang]
31
}
32
33
// Create `<code>`.
0 commit comments