quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.95k stars 326 forks source link

Code annotations not available for haskell. #10600

Open sasja-san opened 2 months ago

sasja-san commented 2 months ago

Bug description

Code annotations won't appear for haskell.

---
format:
  html:
    code-annotations: true
---

```{.haskell}
fact :: Int -> Int          {- <1> -}
fact n = n * (fact (n-1))   {- <2> -}
  1. aueo
  2. htns
fact :: Int -> Int          -- <1>
fact n = n * (fact (n-1))   -- <2>
  1. aueo
  2. htns

Here's how it looks in the document I'm working on.

quarto-haskell-annotations-bug

Quarto check output

Using latest git version. All modules OK except R installation (None).

sasja@ed800:~/.quarto/quarto-cli$ git show -s --format="%as %H"
2024-08-22 09c61d5d9429b6bd9128d9743a9b5027239a9bfc
mcanouil commented 2 months ago

It works just fine assuming you are using the proper code cell language and the proper inline comment syntax.

InputOutput
````qmd --- format: html: code-annotations: true --- ```{.haskell} fact :: Int -> Int -- <1> fact n = n * (fact (n-1)) -- <2> ``` 1. aueo 2. htns ```` image

For the future, prefer opening a discussion rather than an issue. Thanks.

sasja-san commented 2 months ago

Lol so I had to match up {.haskell} with --?

Well, at least there's an inconsistency here: When I do this for C it works with long comment syntax. How was I supposed to know what works? I searched the Quarto site and only found this: https://quarto.org/docs/output-formats/all-formats.html#more-formats and the Code Annotation page didn't say much about languages either.

cscheid commented 2 months ago

I think this is simply that we're missing the multiline comment syntax for Haskell.