Skip to content

Conversation

@asinghvi17
Copy link
Collaborator

@asinghvi17 asinghvi17 commented May 31, 2025

Markdown backends may sanitize text to avoid HTML detection in Markdown objects, permitting raw nodes may prevent that.

If this makes sense, I can add a test etc.

Markdown backends may sanitize text to avoid HTML detection in Markdown objects, permitting raw nodes may prevent that.
@mortenpi
Copy link
Member

mortenpi commented Jun 1, 2025

Can you explain the use case here a bit? You have an at-eval block that tries to interpolate a Documenter.RawNode?

In general, I'd like the at-eval blocks to be a bit more powerful in this respect (being able to eval raw HTML into a document can often be handy). But I am not 100% sure exposing RawNode is the right approach.

@asinghvi17
Copy link
Collaborator Author

Specifically I want to interpolate a video tag but only if the page is not in draft mode (otherwise it breaks the Vitepress build)

@mortenpi
Copy link
Member

mortenpi commented Jun 2, 2025

Should we maybe use the standard Docs.HTML for that? I.e. if the block returns that, we'll just convert it to an @raw html node?

@asinghvi17
Copy link
Collaborator Author

asinghvi17 commented Jun 4, 2025

That loses the ability to return other forms of raw content, like Markdown, though (Docs doesn't seem to have a markdown thing). Specifically the thing of interest there is to avoid automated markdown sanitization, for example...

Plus, RawNode is sufficiently simple that I don't think it will change much...

@fingolfin
Copy link
Collaborator

Could you perhaps show an example of how you'd use this?

Even better, could we perhaps add a test case demonstrating (and testing) this?

@fingolfin fingolfin added the Status: Waiting for Author The issue or pull request needs some action by its author label Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Status: Waiting for Author The issue or pull request needs some action by its author

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants