Summary
Lowdown some minor issues
Metadata
- Id: ec51d1edca22e8611b98f2e8453b673d777328eb
- Trac id: 1731
- Type: defect
- Reporter: Idiomdrottning
- Owner: syn
- Cc:
- Status: assigned
- Component: extensions
- Estimated difficulty:
- Resolution:
- Priority: not urgent at all
- Milestone: someday
- Version: 5.1.0
- Changetime: 2021-04-14 21:16:03 UTC
- Created: 2021-03-11 15:43:30 UTC
- Keywords:
Description
These are already fixed and on their way to upstream, but just in case someone else has the same problems.
I changed one cons to be one append (in tight lists only); the bug was that
(pp (markdown->sxml "* like this"))
produced
(ul (li ("like" " " "this")))
instead of, what it does now,
(ul (li "like" " " "this"))
This also fixes nested lists too, when you have a new bullet list or ordered list inside the item.
The other problem was that it believed <html> to be an in line element so <html><body>hi</body></html> did not work while <html> in an <i> or something worked. Just adding html among the block elements worked as a workaround but then <blockquote><html>hi</html></ blockquote> worked (it already did so that wasn't a regression. Just not right). So now it's a root element, it's own thing basically.
My repo with these fixes are at https://idiomdrottning.org/lowdown
Changes and comments
[2021-03-13 03:12:08 UTC] Idiomdrottning wrote:
I've found three other issues.
• in a line of text that ends with a colon, ref links don't work: • and it can't handle this construction alt textref label]label (basically <a href><img/></a>) • and this is the worst one, it can't handle newlines in html inlines
For that last one, I've solved it "good enough" for my running code but not pushed it to my branch yet.
Basically, in (define inline (...)), there is a space+ but instead it needs to have an, uh, spaces-and-or-newlines+. I hacked one up for my own use as a workaround and I'll see if I can figure out something more beautiful for the longer run and push that.
This was a breaking issue in my production code so I'm glad to have come up with a workaround that works.
Basically, this didn't work:
(pp (markdown->sxml "<small>three small lines</small>"))
[2021-03-13 08:56:22 UTC] mario changed status from new to assigned
[2021-03-13 08:56:22 UTC] mario set owner to syn
[2021-04-14 21:08:55 UTC] Idiomdrottning wrote:
(define space-new-line-chars
(char-set #\space #\tab #\newline #\return))
(define space-new-line-char
(preceded-by (in space-new-line-chars)
(result " ")))
(define snl+
(as-string (one-or-more space-new-line-char)))
(define inline
(any-of inline-hook-parser
(is #\>)
(as-string (one-or-more normal-char))
ul-or-star-line
space+
snl+
strong
emph
image
link
code
html-inline
entity
(as-string escaped-char)
(as-string special-char)))
[2021-04-14 21:16:03 UTC] Idiomdrottning wrote:
<noel> snan: don't forget #\vtab