Closed cderv closed 3 weeks ago
Thanks for this - makes sense that it's in the footer as it's showing on every page. I have rather complex footers that use site variables, etc., so I don't know how many others will run into this, but at least I know how to fix it for now.
I just noticed that this works.
website:
page-footer:
center: 'Project "created"'
but not
website:
page-footer:
center:
- text: 'Project "created"'
Related in a way
Ok so #8575 gave me some hints, and this happens because we do create this hidden div
:::{.hidden render-id="footer-center-Project "created""}
Project "created"
:::
For the rendering, and the render-id
attribute is not valid. The double quotes are not escaped
> quarto pandoc -t native -f markdown
:::{.hidden render-id="footer-center-Project "created""}
Project "created"
:::
^Z
[ Para
[ Str ":::{.hidden"
, Space
, Str "render-id="
, Quoted DoubleQuote [ Str "footer-center-Project" ]
, Str "created\8221"
, Quoted DoubleQuote [ Str "}" , SoftBreak , Str "Project" ]
, Str "created\8221"
, SoftBreak
, Str ":::"
]
]
Escaping works
> quarto pandoc -t native -f markdown
:::{.hidden render-id="footer-center-Project \"created\""}
Project "created"
:::
^Z
[ Div
( ""
, [ "hidden" ]
, [ ( "render-id" , "footer-center-Project \"created\"" ) ]
)
[ Para
[ Str "Project"
, Space
, Quoted DoubleQuote [ Str "created" ]
]
]
]
Using "Project 'created'"
creates
:::{.hidden render-id="footer-center-Project 'created'"}
Project 'created'
:::
so it works
no issue when using center: 'Project "created"'
, it works because we use a global id
:::{.hidden render-id="footer-center"}
Project "created"
:::
Experienced the same when using double-quotes to add information to the footer (adding some custom HTML). As soon as it contains "
the <p>:::</p>
artifact is added at the end of each main.contaner
as described above.
Tested with quarto release version 1.4.554
as well as with pre-release candidates 1.5.37and
1.5.39`, all showing the same behavior (Ubuntu linux).
Can easily be reproduced by adding the following to the footer (left, right, or center):
website:
page-footer:
center:
- text: '<a href=\"www.google.com\">foo</a>'
Same when using not escaping the double quotes ("
instead of \"
).
As outlined above, changing the quotes resolves the issue; artifacts no longer created.
- text: "<a href='www.google.com'>foo</a>"
_Originaly discussed in https://github.com/quarto-dev/quarto-cli/discussions/8931
Create a website
Add the following to
_quarto.yml
underwebsite
quarto preview
This will look like this:
Now change the quoting of the YAML field
The
:::
will disappearIt happens in 1.4 but not in 1.3
So probably something with
key: 'value'
is not the same askey: "value"
in YAML (double quotes and single quotes have different escaping behavior)