Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trailing ::: at bottom of rendered html pages depending on quoting in page-footer #8932

Closed
cderv opened this issue Feb 29, 2024 Discussed in #8931 · 4 comments · Fixed by #11097
Closed

Trailing ::: at bottom of rendered html pages depending on quoting in page-footer #8932

cderv opened this issue Feb 29, 2024 Discussed in #8931 · 4 comments · Fixed by #11097
Assignees
Labels
bug Something isn't working websites Issues creating websites
Milestone

Comments

@cderv
Copy link
Collaborator

cderv commented Feb 29, 2024

_Originaly discussed in #8931

  • Create a website

     quarto create website test-quarto-website
  • Add the following to _quarto.yml under website

       page-footer:
         center:
           - text: 'Project "created"'
  • quarto preview

This will look like this:
image

Now change the quoting of the YAML field

  page-footer:
    center:
      - text: "Project 'created'"

The ::: will disappear

image

It happens in 1.4 but not in 1.3

So probably something with

  • How we process page footer exactly ?
  • The fact that key: 'value' is not the same as key: "value" in YAML (double quotes and single quotes have different escaping behavior)
@cderv cderv added the bug Something isn't working label Feb 29, 2024
@cderv cderv self-assigned this Feb 29, 2024
@cderv cderv added the websites Issues creating websites label Feb 29, 2024
@jhelvy
Copy link

jhelvy commented Feb 29, 2024

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.

@cderv
Copy link
Collaborator Author

cderv commented Mar 13, 2024

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

@cderv
Copy link
Collaborator Author

cderv commented Mar 13, 2024

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"
:::

@retostauffer
Copy link

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.

Software/system

Tested with quarto release version 1.4.554 as well as with pre-release candidates 1.5.37and1.5.39`, all showing the same behavior (Ubuntu linux).

Reproducing the error

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 \").

Fix (changing quotes)

As outlined above, changing the quotes resolves the issue; artifacts no longer created.

      - text: "<a href='www.google.com'>foo</a>" 

@cscheid cscheid added this to the v1.5 milestone Jun 5, 2024
@cscheid cscheid modified the milestones: v1.5, v1.6 Jun 17, 2024
@cscheid cscheid self-assigned this Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working websites Issues creating websites
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants