Skip to content

Commit c5e85c0

Browse files
committed
changelog
1 parent 2039b17 commit c5e85c0

File tree

4 files changed

+43
-0
lines changed

4 files changed

+43
-0
lines changed

news/changelog-1.5.md

+4
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,10 @@ All changes included in 1.5:
106106

107107
- ([#8939](https://github.com/quarto-dev/quarto-cli/pull/8939)): `quarto inspect` now takes an additional optional parameter to specify the output file, and provides the graph of include dependencies for the inspection target.
108108

109+
## Quarto's input format
110+
111+
- Quarto now supports raw block and raw inline elements of types `pandoc-native` and `pandoc-json`, and will use Pandoc's `native` and `json` reader to convert these elements to Pandoc's AST. This is useful in situations where emitting Markdown is not sufficient or convient enough to express the desired structure of a document.
112+
109113
## Other Fixes and Improvements
110114

111115
- ([#8119](https://github.com/quarto-dev/quarto-cli/issues/8119)): More intelligently detect when ejs templates are modified during development, improving quality of life during preview.

src/resources/filters/normalize/extractquartodom.lua

+15
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,21 @@ function parse_md_in_html_rawblocks()
2525
end
2626
return make_scaffold(pandoc.Span, inlines)
2727
end
28+
end,
29+
RawBlock = function(raw)
30+
if raw.format == "pandoc-native" then
31+
return pandoc.read(raw.text, "native").blocks
32+
elseif raw.format == "pandoc-json" then
33+
return pandoc.read(raw.text, "json").blocks
34+
end
35+
end,
36+
RawInline = function(raw)
37+
if raw.format == "pandoc-native" then
38+
return quarto.utils.as_inlines(pandoc.read(raw.text, "native").blocks)
39+
elseif raw.format == "pandoc-json" then
40+
-- let's try to be minimally smart here, and handle lists differently from a single top-level element
41+
return quarto.utils.as_inlines(pandoc.read(raw.text, "json").blocks)
42+
end
2843
end
2944
}
3045
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
format: html
3+
_quarto:
4+
tests:
5+
html:
6+
ensureFileRegexMatches:
7+
- ["--"]
8+
- ["–"]
9+
---
10+
11+
(The JSON syntax is decidedly more verbose and not as nice, and really intended to be used by machine-generated markdown.)
12+
13+
Here is a string that shouldn't be escaped: `{"pandoc-api-version":[1,23,1],"meta":{},"blocks":[{"t":"Plain","c":[{"t":"Str","c":"do--not--escape--this"}]}]}`{=pandoc-json}.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
format: html
3+
_quarto:
4+
tests:
5+
html:
6+
ensureFileRegexMatches:
7+
- ["--"]
8+
- ["–"]
9+
---
10+
11+
Here is a string that shouldn't be escaped: `Str "do--not--escape--this"`{=pandoc-native}.

0 commit comments

Comments
 (0)