Opened 4 years ago

Last modified 4 years ago

#1731 assigned defect

Lowdown some minor issues

Reported by: Idiomdrottning Owned by: Moritz Heidkamp
Priority: not urgent at all Milestone: someday
Component: extensions Version: 5.1.0
Keywords: Cc:
Estimated difficulty:

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

Change History (4)

comment:1 Changed 4 years ago by Idiomdrottning

I've found three other issues.

  • in a line of text that ends with a colon, [shortcut ref links don't work]:
  • and it can't handle this construction [![Img alt text][img ref label]][link 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>"))

comment:2 Changed 4 years ago by Mario Domenech Goulart

Owner: set to Moritz Heidkamp
Status: newassigned

comment:3 Changed 4 years ago by Idiomdrottning

(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)))

comment:4 Changed 4 years ago by Idiomdrottning

<noel> snan: don't forget #\vtab

Note: See TracTickets for help on using tickets.