We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
In the tree output from the toHast function there is a string like
lineBreak\u000bThis line contains a shift-enter soft line-break here\u000bThis bit is after the line break.
This string contains the "U+000B Line Tabulation" control character.
This is replaced by   in the HTML code, after running it through the following code:
 
let html = unified() .use(rehypeStringify, { collapseEmptyAttributes: true }) .stringify(tree);
Do you know how I can preserve this control character or replace it with the HTML hex reference ?

The text was updated successfully, but these errors were encountered:
This is rehypeStringify behavior. You can replace the tree before passing to unified() process.
rehypeStringify
unified()
As a side node, my solution was replacing it with <br />:
<br />
function convertVerticalTabToBr(node: RootContent): void { visit(node, "text", function (node, index, parent) { if (node.type === "text") { const textNode = node as Text if (textNode.value.includes("\u000b")) { const texts = textNode.value .split("\u000b") .flatMap((item) => [{ ...textNode, value: item }, h("br")]) .slice(0, -1) if (index !== null && parent) { // remove and insert parent.children.splice(index, 1, ...texts) } } } }) }
Sorry, something went wrong.
jpoehnelt
No branches or pull requests
In the tree output from the toHast function there is a string like
lineBreak\u000bThis line contains a shift-enter soft line-break here\u000bThis bit is after the line break.
This string contains the "U+000B Line Tabulation" control character.
This is replaced by
 
in the HTML code, after running it through the following code:Do you know how I can preserve this control character or replace it with the HTML hex reference

?The text was updated successfully, but these errors were encountered: