mdast-util-to-hast
Advanced tools
Comparing version 10.1.1 to 10.2.0
@@ -9,4 +9,7 @@ 'use strict' | ||
var 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. | ||
var lang = node.lang && node.lang.match(/^[^ \t]+(?=[ \t]|$)/) | ||
var props = {} | ||
var code | ||
@@ -17,3 +20,9 @@ if (lang) { | ||
return h(node.position, 'pre', [h(node, 'code', props, [u('text', value)])]) | ||
code = h(node, 'code', props, [u('text', value)]) | ||
if (node.meta) { | ||
code.data = {meta: node.meta} | ||
} | ||
return h(node.position, 'pre', [code]) | ||
} |
{ | ||
"name": "mdast-util-to-hast", | ||
"version": "10.1.1", | ||
"version": "10.2.0", | ||
"description": "mdast utility to transform to hast", | ||
@@ -52,3 +52,3 @@ "license": "MIT", | ||
"tinyify": "^3.0.0", | ||
"xo": "^0.36.0" | ||
"xo": "^0.37.0" | ||
}, | ||
@@ -87,2 +87,3 @@ "scripts": { | ||
"rules": { | ||
"unicorn/explicit-length-check": "off", | ||
"unicorn/prefer-includes": "off" | ||
@@ -89,0 +90,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
33749
728