exercism / exercism/problem-specifications

markdown: add test for multiple lists

Open
#1,664 8 comments 1 reaction 0 assignees View on GitHub
hold
Dominant language
Ruby
Stars
358
Forks
563
Avg merge
18h 41m
Merged PRs (30d)
2

Description

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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.