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

if qmd filename contains "--" inside, quarto isnt working correctly processing CSS reveal #9117

Closed
mrossde opened this issue Mar 17, 2024 · 2 comments · Fixed by #9221
Closed
Assignees
Labels
bug Something isn't working revealjs Issues with the revealjs format
Milestone

Comments

@mrossde
Copy link

mrossde commented Mar 17, 2024

Bug description

Hello,

if i put "--" inside the filename , quarto is throwing following errors:

`PS D:\z_HS\proj\Techn_DE\inhalte_technischedatenerfassung\00_Inhalte> quarto preview d:/z_HS/proj/Techn_DE/inhalte_technischedatenerfassung/00_Inhalte/test01--04.qmd --no-browser --no-watch-inputs
pandoc 
  to: revealjs
  from: markdown+emoji
  output-file: test01--04.html
  standalone: true
  self-contained: false
  wrap: none
  default-image-extension: png
  html-math-method:
    method: mathjax
    url: >-
      https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=TeX-AMS_HTML-full
  slide-level: 3
  toc: true
  toc-depth: 1
  number-sections: true
  css:
    - style.css
  
metadata
  link-citations: true
  width: 1050
  height: 700
  margin: 0.1
  center: false
  navigationMode: linear
  controlsLayout: edges
  controlsTutorial: false
  hash: true
  history: true
  hashOneBasedIndex: false
  fragmentInURL: false
  transition: none
  backgroundTransition: none
  pdfSeparateFragments: false
  lang: en
  auto-stretch: true
  theme:
    - default
    - _extensions/grantmcdermott/clean/clean.scss
  menu:
    side: left
  slideNumber: c/t
  date-format: long
  title: 'test '
  author:
    name: test
    orcid: 0000-0021-7213-4711
    email: mr@test.com
    affiliations: company x
  copyright:
    holder: Prof. Mario Roßdeutscher
    year: 2023
  license: CC BY
  date: last-modified
  bibliography:
    - refs.bib
  toc-title: TOC
  footer: footer test
  logo: images/HochschuleEsslingen_Logo_Goeppingen_SW_DE.png
  scrollable: true

Output created: test01--04.html

Watching files for changes
Browse at http://localhost:3942/test01--04.html
ERROR: 500 (Internal Error): Unexpected end of JSON input
  /test01–04_files/libs/revealjs/dist/reset.css (404: Not Found)
  /test01–04_files/libs/revealjs/dist/reveal.css (404: Not Found)
  /test01–04_files/libs/revealjs/dist/theme/quarto.css (404: Not Found)
  /test01–04_files/libs/revealjs/dist/reveal.js (404: Not Found)
  /test01–04_files/libs/revealjs/plugin/quarto-line-highlight/line-highlight.js (404: Not Found)
  /test01–04_files/libs/revealjs/plugin/reveal-menu/menu.js (404: Not Found)
  /test01–04_files/libs/revealjs/plugin/pdf-export/pdfexport.js (404: Not Found)
  /test01–04_files/libs/revealjs/plugin/reveal-menu/quarto-menu.js (404: Not Found)
  /test01–04_files/libs/revealjs/plugin/quarto-support/support.js (404: Not Found)
  /test01–04_files/libs/revealjs/plugin/notes/notes.js (404: Not Found)
  /test01–04_files/libs/revealjs/plugin/search/search.js (404: Not Found)
  /test01–04_files/libs/revealjs/plugin/math/math.js (404: Not Found)
  /test01–04_files/libs/revealjs/plugin/zoom/zoom.js (404: Not Found)
  /test01–04_files/libs/revealjs/dist/reveal.js (404: Not Found)
  /test01–04_files/libs/revealjs/plugin/quarto-line-highlight/line-highlight.js (404: Not Found)
  /test01–04_files/libs/revealjs/plugin/pdf-export/pdfexport.js (404: Not Found)
  /test01–04_files/libs/revealjs/plugin/reveal-menu/menu.js (404: Not Found)
  /test01–04_files/libs/revealjs/plugin/reveal-menu/quarto-menu.js (404: Not Found)
  /test01–04_files/libs/revealjs/plugin/quarto-support/support.js (404: Not Found)
  /test01–04_files/libs/revealjs/plugin/notes/notes.js (404: Not Found)
  /test01–04_files/libs/revealjs/plugin/search/search.js (404: Not Found)
  /test01–04_files/libs/revealjs/plugin/zoom/zoom.js (404: Not Found)
  /test01–04_files/libs/revealjs/plugin/math/math.js (404: Not Found)
`

Steps to reproduce

Here is the qmd and html file attached

00_Inhalte.zip

and here is the content of the file

---
title: "test "
from: markdown+emoji
format:
  revealjs:
    self-contained: false
    footer: "footer test"
    slide-number: c/t
    slide-level: 3
    css: style.css
    scrollable: true
  html:
    mermaid:
      theme: dark
    embed-resources: false
    link-external-icon: true
    link-external-newwindow: true
    tbl-cap-location: bottom
author:
    name: "test"
    orcid: 0000-0021-7213-4711
    email: mr@test.com
    affiliations: company x
date: last-modified
toc: true
toc-title: TOC
toc-depth: 1
number-sections: true
execute:
    echo: true
---

a little test

Expected behavior

as it works normally, when we just rename the file from test01--04.qmd to test01-04.qmd

Actual behavior

see the above error, the html file is built, but without CSS styling

Your environment

Windows 10
IDE: Visual Studio Code
Quarto: 1.4.549

Quarto check output

Quarto 1.4.549
[>] Checking versions of quarto binary dependencies...
      Pandoc version 3.1.11: OK
      Dart Sass version 1.69.5: OK
      Deno version 1.37.2: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
      Version: 1.4.549
      Path: C:\Program Files\Quarto\bin
      CodePage: 1252

[>] Checking tools....................OK
      TinyTeX: (not installed)
      Chromium: (not installed)

[>] Checking LaTeX....................OK
      Tex:  (not detected)

[>] Checking basic markdown render....OK

[>] Checking Python 3 installation....OK
      Version: 3.11.5 (Conda)
      Path: D:/Programme/anaconda3/python.exe
      Jupyter: 5.3.0
      Kernels: python3

[>] Checking Jupyter engine render....OK

[>] Checking R installation...........(None)

      Unable to locate an installed version of R.
      Install R from https://cloud.r-project.org/
@mrossde mrossde added the bug Something isn't working label Mar 17, 2024
@cderv
Copy link
Collaborator

cderv commented Mar 18, 2024

Thanks for the report.

This is a pretty narrow edge case encountered here.

  • The filename will be used to create the resource folder *_files

  • In revealjs case, it will be used as $revealjs-url$ to be included as Pandoc's variable in the template

  • This revealjs-url variable is set internally by Quarto when not provided by users, and as other metadata we use a YAML to pass to metadata-file for setting those values.

  • In pandoc, metadata-file values will always be parsed as Markdown strings

    Read metadata from the supplied YAML (or JSON) file. This option can be used with every input format, but string scalars in the metadata file will always be parsed as Markdown.

    and this is why the -- is seen as en-dash because the +smart extension is used by default

So this is really unfortunate combination. Same for reveal-jsscripts

Impacted lines

<script src="$revealjs-url$/dist/reveal.js"></script>
<!-- reveal.js plugins -->
$for(reveal-jsscripts)$<script src="$reveal-jsscripts$"></script>
$endfor$
<script src="$revealjs-url$/plugin/notes/notes.js"></script>
<script src="$revealjs-url$/plugin/search/search.js"></script>
<script src="$revealjs-url$/plugin/zoom/zoom.js"></script>
$if(mathjax)$
<script src="$revealjs-url$/plugin/math/math.js"></script>
$endif$

<link rel="stylesheet" href="$revealjs-url$/dist/reset.css">
<link rel="stylesheet" href="$revealjs-url$/dist/reveal.css">

$if(theme)$
<link rel="stylesheet" href="$revealjs-url$/dist/theme/$theme$.css">
$else$
<link rel="stylesheet" href="$revealjs-url$/dist/theme/black.css">
$endif$

One thing that comes to mind is just escaping -- with \-\- so that it is parsed not as en-dash

> quarto pandoc -t native -f markdown+smart
--

\-\-
^Z
[ Para [ Str "\8211" ] , Para [ Str "--" ] ]

Though I suspect this will be an issue for other type of values 🤔 I think we encountered this already - I'll try to connect

@cderv cderv added the revealjs Issues with the revealjs format label Mar 18, 2024
@cderv cderv self-assigned this Mar 18, 2024
@mrossde
Copy link
Author

mrossde commented Mar 21, 2024

Thanks for information! Best Regards, Mario

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working revealjs Issues with the revealjs format
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants