Skip to content

Commit

Permalink
Change to remove support for ancient lang on code with spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jul 16, 2023
1 parent 72b8a68 commit 6fc783a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/handlers/code.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@
*/
export function code(state, node) {
const value = node.value ? node.value + '\n' : ''
// To do: next major, use `node.lang` w/o regex, the splitting’s been going
// on for years in remark now.
const lang = node.lang ? node.lang.match(/^[^ \t]+(?=[ \t]|$)/) : undefined
/** @type {Properties} */
const properties = {}

if (lang) {
properties.className = ['language-' + lang]
if (node.lang) {
properties.className = ['language-' + node.lang]
}

// Create `<code>`.
Expand Down

0 comments on commit 6fc783a

Please sign in to comment.