diff --git a/apps/vscode/CHANGELOG.md b/apps/vscode/CHANGELOG.md index 4cc39c58..25c79006 100644 --- a/apps/vscode/CHANGELOG.md +++ b/apps/vscode/CHANGELOG.md @@ -3,6 +3,7 @@ ## 1.116.0 (Not yet released) - Fix issue with raw html blocks being removed from document by Visual Editor () +- Fix issue with raw latex blocks being removed from document by Visual Editor () ## 1.115.0 (Release on 20 September 2024) diff --git a/packages/editor-server/src/resources/md-writer.lua b/packages/editor-server/src/resources/md-writer.lua index 1964953c..00ad6558 100644 --- a/packages/editor-server/src/resources/md-writer.lua +++ b/packages/editor-server/src/resources/md-writer.lua @@ -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) @@ -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 }