File tree Expand file tree Collapse file tree 2 files changed +23
-10
lines changed
resources/filters/quarto-pre Expand file tree Collapse file tree 2 files changed +23
-10
lines changed Original file line number Diff line number Diff line change @@ -216,6 +216,19 @@ function hugoFormat(): Format {
216
216
[ kHtmlMathMethod ] : "webtex" ,
217
217
[ kWrap ] : "preserve" ,
218
218
} ,
219
+ formatExtras : ( ) => {
220
+ return {
221
+ postprocessors : [ ( output : string ) => {
222
+ // unescape shortcodes
223
+ Deno . writeTextFileSync (
224
+ output ,
225
+ Deno . readTextFileSync ( output )
226
+ . replaceAll ( "{{\\<" , "{{<" )
227
+ . replaceAll ( "\\>}}" , ">}}" ) ,
228
+ ) ;
229
+ } ] ,
230
+ } ;
231
+ } ,
219
232
} ) ;
220
233
}
221
234
Original file line number Diff line number Diff line change @@ -98,17 +98,17 @@ function transformShortcodeBlocks(blocks)
98
98
local onlyShortcode = onlyShortcode (block .content )
99
99
if onlyShortcode ~= nil then
100
100
-- there is a shortcode here, process it and return the blocks
101
- local shortCode = processShortCode (onlyShortcode )
102
- local handler = handlerForShortcode (shortCode )
103
- if handler ~= nil then
104
- local transformedShortcode = callShortcodeHandler (handler , shortCode )
105
- if transformedShortcode ~= nil then
106
- tappend (scannedBlocks , shortcodeResultAsBlocks (transformedShortcode , shortCode .name ))
107
- transformed = true
108
- end
109
- else
110
- warn (" Shortcode " .. shortCode .name .. " is not recognized." )
101
+ local shortCode = processShortCode (onlyShortcode )
102
+ local handler = handlerForShortcode (shortCode )
103
+ if handler ~= nil then
104
+ local transformedShortcode = callShortcodeHandler (handler , shortCode )
105
+ if transformedShortcode ~= nil then
106
+ tappend (scannedBlocks , shortcodeResultAsBlocks (transformedShortcode , shortCode .name ))
107
+ transformed = true
111
108
end
109
+ else
110
+ scannedBlocks :insert (block )
111
+ end
112
112
else
113
113
scannedBlocks :insert (block )
114
114
end
You can’t perform that action at this time.
0 commit comments