Re: cmark sxml problem (also chiccup sxml)

Paul Wisehart via Chicken-users <[email protected]> Wed, 22 Apr 2026 08:41:01 -0400
Newsgroups gmane.lisp.scheme.chicken
Message-ID <[email protected]>
On Wed, Apr 22, 2026 at 09:31:39AM +0200, Peter Bex wrote:
> On Tue, Apr 21, 2026 at 12:44:11PM -0400, Paul Wisehart via Chicken-users wrote:
> > Like:
> > ((h1 "Header!")
> >  (p "This is a paragraph..."))
> 
> 
> This is indeed correct SXML.
> 
> > 
> > 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.
> 

Thanks!
This helps a lot.
I will do one of these options, also I will try that SXML->HTML
thing from sxml-transforms.  (I did notice that the tests 
used that and also compare the output to lowdown's, but 
I didn't see where SXML->HTML was from.)

-- Paul :)