yogthos / markdown-clj

Markdown parser in Clojure
Eclipse Public License 1.0
540 stars 120 forks source link

Exception thrown when parsing lists #181

Open jwr opened 2 years ago

jwr commented 2 years ago

When switching from 1.10.9 to 1.11.0 I noticed that markdown-clj is no longer able to parse some of my input files, throwing an exception.

I managed to narrow it down to this:

  (markdown/md-to-html-string "
 * A
* B")

(note the space before the first bullet point)

This results in:

              Numbers.java: 1095  clojure.lang.Numbers/ops
              Numbers.java:  261  clojure.lang.Numbers/gt
                lists.cljc:   18  markdown.lists$add_row/invokeStatic
                lists.cljc:   10  markdown.lists$add_row/invoke
                lists.cljc:   36  markdown.lists$ul/invokeStatic
                lists.cljc:   32  markdown.lists$ul/invoke
                lists.cljc:   68  markdown.lists$li/invokeStatic
                lists.cljc:   44  markdown.lists$li/invoke
                  core.clj:   24  markdown.core/init-transformer/fn/fn
     PersistentVector.java:  343  clojure.lang.PersistentVector/reduce
                  core.clj: 6885  clojure.core/reduce
                  core.clj: 6868  clojure.core/reduce
                  core.clj:   22  markdown.core/init-transformer/fn
                  core.clj:  102  markdown.core/md-to-html
yogthos commented 2 years ago

@jecneps looks like we might have some regressions from the fix here https://github.com/yogthos/markdown-clj/pull/179