Skip to content
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

Replace <code> tags by backticks in temporary .qmd files #290

Open
etiennebacher opened this issue Aug 14, 2024 · 6 comments
Open

Replace <code> tags by backticks in temporary .qmd files #290

etiennebacher opened this issue Aug 14, 2024 · 6 comments

Comments

@etiennebacher
Copy link
Owner

etiennebacher commented Aug 14, 2024

This could help fix formatting of quotation marks in code, e.g. pola-rs/r-polars/issues/655

Cf quarto-dev/quarto-cli#10511

@etiennebacher
Copy link
Owner Author

In .rd2qmd(), we may also want to keep the HTML as-is (for example not replacing heading tags by markdown syntax) and then wrap the whole thing in {=html} so that Quarto parses this as raw HTML.

@vincentarelbundock
Copy link
Collaborator

Would this work for multiline code blocks or just inline?

@etiennebacher
Copy link
Owner Author

I think the issue is just for inline code. For code blocks, the quotation marks are normal: https://pola-rs.github.io/r-polars/vignettes/polars.html#series-and-dataframes

@vincentarelbundock
Copy link
Collaborator

Right. I just wanted to be sure that on the intermediate representation, we never had <code> tags around blocks code. Replacing those by single ticks might break things.

Perhaps that never happens and isn't a concern.

@etiennebacher
Copy link
Owner Author

etiennebacher commented Aug 14, 2024

Replacing those by single ticks might break things.

Hopefully the snapshot tests would catch that. If they don't, something is wrong with them

@etiennebacher
Copy link
Owner Author

Wrapping everything in {=html} (except for examples that would be in {r}) works almost perfectly. The problem is equations since they are wrapped in <code class="reqn">. When this is evaluated as raw HTML then it just gives the latex code but doesn't evaluate it. I put some WIP here but it's mostly so that it's not lost since I don't find a good fix for this: #291


Replacing <code> by backticks is almost perfect but it means that there would be a mix of HTML and markdown syntax for example if there is code in the "Arguments" table. Some doc tools, e.g docute, don't support that and just show the backticks without formatting.

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

No branches or pull requests

2 participants