GNU bug report logs - #69344
ELPA process collapses Markdown fenced code block into 1 line for HTML page

Previous Next

Package: emacs;

Reported by: Okamsn <okamsn <at> protonmail.com>

Date: Sat, 24 Feb 2024 02:18:01 UTC

Severity: normal

To reply to this bug, email your comments to 69344 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#69344; Package emacs. (Sat, 24 Feb 2024 02:18:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Okamsn <okamsn <at> protonmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 24 Feb 2024 02:18:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Okamsn <okamsn <at> protonmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: ELPA process collapses Markdown fenced code block into 1 line for
 HTML page
Date: Sat, 24 Feb 2024 02:16:29 +0000
[Message part 1 (text/plain, inline)]
Hello,

While working on adding my package to Non-GNU ELPA, I noticed that the 
`make build/loopy` process collapsed the fenced code blocks in the file 
"CHANGELOG.md" into 1 line in the HTML output.

I have attached the Markdown file "CHANGELOG.md" and the outputted file 
"loopy.html". The squashed code blocks can be seen towards the end of 
the HTML file when viewed in EWW and Chromium.

Thank you.
[loopy.html (text/html, attachment)]
[CHANGELOG.md (text/markdown, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69344; Package emacs. (Sat, 24 Feb 2024 09:59:02 GMT) Full text and rfc822 format available.

Message #8 received at 69344 <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: Okamsn <okamsn <at> protonmail.com>
Cc: 69344 <at> debbugs.gnu.org
Subject: Re: bug#69344: ELPA process collapses Markdown fenced code block
 into 1 line for HTML page
Date: Sat, 24 Feb 2024 09:57:55 +0000
Okamsn <okamsn <at> protonmail.com> writes:

> Hello,
>
> While working on adding my package to Non-GNU ELPA, I noticed that the 
> `make build/loopy` process collapsed the fenced code blocks in the file 
> "CHANGELOG.md" into 1 line in the HTML output.
>
> I have attached the Markdown file "CHANGELOG.md" and the outputted file 
> "loopy.html". The squashed code blocks can be seen towards the end of 
> the HTML file when viewed in EWW and Chromium.

(In case anyone else is confused by the same thing as I was, apparently
Gnus renders the code blocks and removed the backticks.)

> Thank you.

[...]

>   ```emacs-lisp
>   ;; Now correct behavior (would previously error):
>   ;; => 6
>   (loopy (list i '(1 2 3))
>          (reduce i #'*))
>   ```

Elpa-admin.el uses the original markdown implementation by John Gruber
or markdown2 (https://pypi.org/project/markdown2/) to render Markdown,
which apparently doesn't handle formatted code blocks:

--8<---------------cut here---------------start------------->8---
$ markdown

```emacs-lisp
 ;; Previously erroneously returned 27:
 ;; => nil
 (loopy (with (val 27))
        (list i '(1 2 3))
        (find val nil (> i 10) :on-failure nil)
        (finally-return val))
```

<p><code>emacs-lisp
 ;; Previously erroneously returned 27:
 ;; =&gt; nil
 (loopy (with (val 27))
        (list i '(1 2 3))
        (find val nil (&gt; i 10) :on-failure nil)
        (finally-return val))
</code></p>
--8<---------------cut here---------------end--------------->8---

or rather it handles them as regular fixed-with formatting sequences.
The quick fix would just be to use classical indented code-blocks, but
it would be worth considering a more robust and predictable markdown
implementation like cmark.




This bug report was last modified 70 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.