@@ -126,18 +126,16 @@ local function wrapTypstAnnotatedCode(codeBlock, annotations, cellId)
126126 adjustedAnnotations [annoteId ] = adjusted
127127 end
128128 local dict = typstAnnotationsDict (adjustedAnnotations )
129- local cellIdParam = " "
130- if cellId and cellId ~= " " then
131- cellIdParam = " , cell-id: \" " .. cellId .. " \" "
132- end
133129 local lang = codeBlock .attr .classes [1 ] or " "
134130 local code = codeBlock .text
135131 local maxBackticks = 2
136132 for seq in code :gmatch (" `+" ) do
137133 maxBackticks = math.max (maxBackticks , # seq )
138134 end
139135 local fence = string.rep (" `" , maxBackticks + 1 )
140- local raw = " #quarto-code-annotation(" .. dict .. cellIdParam .. " )[" .. fence .. lang .. " \n " .. code .. " \n " .. fence .. " ]"
136+ local raw = " #quarto-code-annotation(" .. dict
137+ .. (cellId and cellId ~= " " and (" , cell-id: \" " .. cellId .. " \" " ) or " " )
138+ .. " )[" .. fence .. lang .. " \n " .. code .. " \n " .. fence .. " ]"
141139 return pandoc .RawBlock (" typst" , raw )
142140end
143141
@@ -568,14 +566,12 @@ function code_annotations()
568566 end
569567 end
570568
571- local useSkylighting = param (constants .kSyntaxHighlighting , true )
572-
573569 if pendingCodeCell ~= nil then
574570 local resolvedCell = _quarto .ast .walk (pendingCodeCell , {
575571 CodeBlock = function (el )
576572 if el .attr .classes :find (' cell-code' ) or
577573 el .attr .classes :find (constants .kDataCodeAnnonationClz ) then
578- if useSkylighting then
574+ if param ( constants . kSyntaxHighlighting , true ) then
579575 return nil
580576 else
581577 return wrapTypstAnnotatedCode (el , pendingAnnotations , pendingCellId )
@@ -587,12 +583,12 @@ function code_annotations()
587583 local dlDiv = pandoc .Div (annotationBlocks , pandoc .Attr (" " , {constants .kCellAnnotationClass }))
588584 if is_custom_node (resolvedCell ) then
589585 local custom = _quarto .ast .resolve_custom_data (resolvedCell ) or pandoc .Div ({})
590- if useSkylighting then
586+ if param ( constants . kSyntaxHighlighting , true ) then
591587 custom .content :insert (1 , typstAnnotationMarker (pendingAnnotations , pendingCellId ))
592588 end
593589 custom .content :insert (dlDiv )
594590 else
595- if useSkylighting then
591+ if param ( constants . kSyntaxHighlighting , true ) then
596592 resolvedCell .content :insert (1 , typstAnnotationMarker (pendingAnnotations , pendingCellId ))
597593 end
598594 resolvedCell .content :insert (dlDiv )
0 commit comments