-
Notifications
You must be signed in to change notification settings - Fork 131
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
RFC: Replace DocHtmlStartTag
and DocHtmlEndTag
with DocXmlElement
#138
Comments
I wanted to enable general HTML tags, however for security reasons it requires a script sanitizer such as sanitize-html or xss. @iclanton could we add that to the loader? |
dompurify looks to be more self-contained, and is hosted by cdnjs.com. |
@iclanton started a PR #139 to implement this. However, when the playground tries to render We considered trying to match up Thus, I'm proposing to replace |
DocHtmlStartTag
and DocHtmlEndTag
with DocXmlElement
TSDoc parses start and end tags separately and not as a single element, thus it's difficult to correctly render HTML elements with children. Rendering as plaintext increases verbosity and reduces clarity in the rendered documentation. Maybe a future `DocXmlElement` from TSDoc or rendering doc comments as markdown first and then passing to React could solve this issue. See microsoft/tsdoc#138
Hi @octogonz, I would be interested in implementing a Would we still want to store the opening and closing delimiters for both the start and end tags within
Finally in the case of plain text within an XML node ( |
Hey @suneettipirneni, that would be awesome to finally get this implemented! I haven't thought about it in a long time.
Hmm... I haven't thought about this in a long time. 🙂 I think the AST is designed with excerpts as the leaf nodes, so it would be something like this: Sample input: <a>hi<b /></a> AST pseudocode:
Note that An AST visitor would be interested in the meaningful nodes
Yes, it would be a
Yes. Also keep in mind that the AST is intended to represent syntax errors as well, faithfully enough that it can regenerate the original input. Consider this example:
Maybe it would get represented as:
Here A web HTML parser has quite sophisticated heuristics that would try to render a sensible web page from broken syntax, for example inferring |
Much appreciated! I apologize for the slow response -- I've been really busy this week. I will take a look over the weekend. Thanks for patience! |
Markdown table or HTML table element can't be rendered correctly in TSDoc playground
The text was updated successfully, but these errors were encountered: