Skip to content

Allow Documenter.RawNode through @eval #2734

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants