File tree Expand file tree Collapse file tree 2 files changed +9
-15
lines changed Expand file tree Collapse file tree 2 files changed +9
-15
lines changed Original file line number Diff line number Diff line change @@ -401,8 +401,8 @@ function setupDraggableElt(elt) {
401401 }
402402}
403403
404- async function saveMovedElts ( ) {
405- index = await readIndexQmd ( ) ;
404+ function saveMovedElts ( ) {
405+ index = readIndexQmd ( ) ;
406406 Elt_dim = extracteditableEltDimensions ( ) ;
407407
408408 index = udpdateTextDivs ( index ) ;
@@ -412,19 +412,8 @@ async function saveMovedElts() {
412412 downloadString ( index ) ;
413413}
414414// Function to read index.qmd file
415- async function readIndexQmd ( ) {
416- try {
417- const filename = geteditableFilename ( ) ;
418- const response = await fetch ( filename ) ;
419- if ( ! response . ok ) {
420- throw new Error ( `HTTP error! status: ${ response . status } ` ) ;
421- }
422- const content = await response . text ( ) ;
423- return content ;
424- } catch ( error ) {
425- console . error ( "Error reading index.qmd:" , error ) ;
426- return null ;
427- }
415+ function readIndexQmd ( ) {
416+ return window . _input_file ;
428417}
429418
430419// Function to get data-filename attribute from editable div
Original file line number Diff line number Diff line change 11function Pandoc (doc )
2+ local text = assert (io.open (quarto .doc .input_file , " r" )):read (" a" )
3+ text = string.gsub (text , " \" " , " \\\" " )
4+ text = string.gsub (text , " \n " , " \\ n\" + \" " )
5+ text = " \" " .. text .. " \" "
6+ doc .blocks :insert (pandoc .RawBlock (" html" , " <script> window._input_file = " .. text .. " </script>" ))
27 doc .blocks :insert (pandoc .RawBlock (" html" , " <script> window._input_filename = '" .. quarto .doc .input_file .. " '</script>" ))
38 return doc
49end
You can’t perform that action at this time.
0 commit comments