racket-commonmark icon indicating copy to clipboard operation
racket-commonmark copied to clipboard

Lists of lists marked "loose" when followed by a paragraph

Open Bogdanp opened this issue 1 year ago • 0 comments

In the following example, the outer list is marked as loose when it should be tight:

* Outer a
  * Inner a

Test

Leading to the outer list item being marked in a paragraph when it shouldn't when rendered as HTML. Here's a failing test:

(check-equal?
 (string->document
  #<<EOF
* Outer a
  * Inner a

Test
EOF
    )
 (document
  (list
   (itemization
    (list
     (list
      (paragraph "Outer a")
      (itemization (list (list (paragraph "Inner a"))) 'tight #f)))
    'tight
    #f)
   (paragraph "Test"))
  null))

Outputs:

name:       check-equal?
location:   lists.rkt:8:0
actual:
  (document
 (list
  (itemization
   (list
    (list
     (paragraph "Outer a")
     (itemization (list (list (paragraph "Inner a"))) 'tight #f)))
   'loose
   #f)
  (paragraph "Test"))
 '())
expected:
  (document
 (list
  (itemization
   (list
    (list
     (paragraph "Outer a")
     (itemization (list (list (paragraph "Inner a"))) 'tight #f)))
   'tight
   #f)
  (paragraph "Test"))
 '())
--------------------

On the Commonmark dingus site, this works as expected:

Screenshot 2024-02-05 at 10 05 48

Bogdanp avatar Feb 05 '24 08:02 Bogdanp