-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
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
toString #12
Comments
The initial implementation of x/packages/fringe/src/string.ts Line 95 in 6db6e3c
It it marked as experimental. It includes support for "this" to be bound to, which allows for customisation of how the string is generated. An example of this is the quirks of HTML, including Usage of this can be seen here: function isScalar(node: VNode) {
if (!node.scalar) return false;
const tags: unknown[] = ["script", "link", "meta"];
return !tags.includes(node.source);
}
function getBody(node: VNode, body: string) {
if (body) {
return `\n${body.split("\n").map(value => ` ${value}`).join("\n")}\n`;
}
if (node.source !== "script") {
return ""
}
return "\n";
} const string = await toString.call({ isScalar, getBody }, view); |
By default deno's typescript doesn't like the usage of a |
🚀 Feature Proposal
Produce a string from any vnode
Motivation
To output a vnode as a string for client usage.
Example
Consuming the result iteratively as it is generated:
Resolving the complete string:
The text was updated successfully, but these errors were encountered: