On Tue, Apr 21, 2026 at 12:44:11PM -0400, Paul Wisehart via Chicken-users wrote:
> Hi!,
>
> I am using chiccup to auther html pages
> using what I thought was "SXML".
>
> Like:
> ((h1 "Header!")
> (p "This is a paragraph..."))
Hi Paul!
This is indeed correct SXML.
> This works great.
>
> Now I am using cmark to process markdown
> to sxml and intermix it into the chiccup.
>
> The problem is that in cmark and specifically
> (cmark-sxml "# Header!
> This is a paragraph...")
>
> The output sxml is like:
> ((h1 ("Header!"))
> (p ("This is a paragrapoh...")))
>
> Why does cmark-sxml wrap those atoms in
> parenthesis? It is messing up the
> final conversion to html.
It looks like a bug of sorts in cmark. Note that a lot of the SXML
tools from the SSAX project are lenient and will allow for such
"sloppy" SXML, but AFAIK it's not valid SXML (see also the grammar
in the official spec at https://okmij.org/ftp/Scheme/SXML.html).
The test suite for cmark uses SXML->HTML from sxml-transforms, which
is lenient (like described above) and which is probably why this went
unnoticed.
Anyway, to change this, you would have to modify the cmark egg. I don't
recognise the author's name, and I don't know if they are still active
in the community, so you may have to take over maintenance of this egg.
Another solution could be to change chiccup to be more lenient with
such sloppy SXML.
Finally, you could try the lowdown egg instead to generate the SXML.
Hope this helps!
Cheers,
Peter