exercism / exercism/problem-specifications

markdown: add test for multiple lists

Đang mở
#1,664 8 bình luận 1 reaction 0 người được giao Xem trên GitHub
hold
Ngôn ngữ chính
Ruby
Star
358
Fork
563
Merge trung bình
18 giờ 41 phút
Pull request đã merge (30 ngày)
2

Mô tả

I was just going to suggest adding an additional test to ensure that the code handles multiple lists properly. In my solution to the problem, I used a regex to insert the `

    ` tags at the appropriate locations. Originally I had just `(
  • .*
  • )` which passed all the tests, but which will work ONLY WHEN YOU HAVE A SINGLE LIST in your markdown text. If you have more than one, it'll put a single pair of `
      ` tags around all of them (beginning of the first, end of the last) and whatever headers and paragraphs are found between.

      My current regex `(

    • .*?
    • )(<[ph])|(
    • .*
    • )` handles multiple lists correctly, as far as I can tell. The first half (before the '|') catches string-initial or internal lists, while the latter half will kick in to handle string-terminal lists.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.