mdast-util-to-hast
Advanced tools
Comparing version 13.0.0 to 13.0.1
@@ -294,3 +294,3 @@ /** | ||
if (!Array.isArray(result) && result.type === 'text') { | ||
result.value = result.value.replace(/^\s+/, '') | ||
result.value = trimMarkdownSpaceStart(result.value) | ||
} | ||
@@ -302,3 +302,3 @@ | ||
if (head && head.type === 'text') { | ||
head.value = head.value.replace(/^\s+/, '') | ||
head.value = trimMarkdownSpaceStart(head.value) | ||
} | ||
@@ -452,1 +452,21 @@ } | ||
} | ||
/** | ||
* Trim spaces and tabs at the start of `value`. | ||
* | ||
* @param {string} value | ||
* Value to trim. | ||
* @returns {string} | ||
* Result. | ||
*/ | ||
function trimMarkdownSpaceStart(value) { | ||
let index = 0 | ||
let code = value.charCodeAt(index) | ||
while (code === 9 || code === 32) { | ||
index++ | ||
code = value.charCodeAt(index) | ||
} | ||
return value.slice(index) | ||
} |
{ | ||
"name": "mdast-util-to-hast", | ||
"version": "13.0.0", | ||
"version": "13.0.1", | ||
"description": "mdast utility to transform to hast", | ||
@@ -49,4 +49,4 @@ "license": "MIT", | ||
"c8": "^8.0.0", | ||
"hast-util-to-html": "^8.0.4", | ||
"hastscript": "^7.0.0", | ||
"hast-util-to-html": "^9.0.0", | ||
"hastscript": "^8.0.0", | ||
"mdast-util-from-markdown": "^2.0.0", | ||
@@ -113,2 +113,3 @@ "mdast-util-gfm": "^3.0.0", | ||
"unicorn/prefer-at": "off", | ||
"unicorn/prefer-code-point": "off", | ||
"unicorn/prefer-string-replace-all": "off" | ||
@@ -115,0 +116,0 @@ } |
@@ -318,3 +318,3 @@ # mdast-util-to-hast | ||
Handle a node (TypeScript). | ||
Handle a node (TypeScript type). | ||
@@ -336,3 +336,3 @@ ###### Parameters | ||
Handle nodes (TypeScript). | ||
Handle nodes (TypeScript type). | ||
@@ -347,3 +347,3 @@ ###### Type | ||
Configuration (TypeScript). | ||
Configuration (TypeScript type). | ||
@@ -386,3 +386,3 @@ ###### Fields | ||
Raw string of HTML embedded into HTML AST (TypeScript). | ||
Raw string of HTML embedded into HTML AST (TypeScript type). | ||
@@ -389,0 +389,0 @@ ###### Type |
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
2627
124210
61