Skip to content

Fix roundtripping of raw latex blocks #559

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

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 1.116.0 (Not yet released)

- Fix issue with raw html blocks being removed from document by Visual Editor (<https://github.com/quarto-dev/quarto/issues/552>)
- Fix issue with raw latex blocks being removed from document by Visual Editor (<https://github.com/quarto-dev/quarto/issues/558>)

## 1.115.0 (Release on 20 September 2024)

Expand Down
9 changes: 7 additions & 2 deletions packages/editor-server/src/resources/md-writer.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
---@diagnostic disable: undefined-global
---
--- Writer for markdown that preserves raw html attributes.
--- Writer for markdown that preserves raw html and latex attributes.
---
--- This changed in pandoc 3.2, see https://github.com/rstudio/rstudio/issues/15189.
--- This changed in pandoc 3.2, see:
--- https://github.com/quarto-dev/quarto/issues/552
--- https://github.com/quarto-dev/quarto/issues/558

local html_formats = pandoc.List{'html', 'html4', 'html5'}
function Writer (doc, opts)
Expand All @@ -12,6 +14,9 @@ function Writer (doc, opts)
if html_formats:includes(raw.format) then
local md = pandoc.write(pandoc.Pandoc(raw), 'markdown-raw_html')
return pandoc.RawBlock('markdown', md)
elseif "latex" == raw.format then
local md = pandoc.write(pandoc.Pandoc(raw), 'markdown-raw_tex')
return pandoc.RawBlock('markdown', md)
end
end
}
Expand Down