-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes unintentional newline characters within lists with paragraphs
This commit aims to fix a problem when parsing markup similar to: ```ruby [8] pry(main)> ReverseMarkdown.convert("<ul><li> <p>a</p></li></ul>") => "- \n\na\n\n" ``` Note that the list item has newlines between the markdown list item and the actual text. If you remove the space between the list item tag and the paragraph tag: ```ruby [7] pry(main)> ReverseMarkdown.convert("<ul><li><p>a</p></li></ul>") => "- a\n\n" ``` Reverse markdown appears to assume what believe to be the intended behaviour. There was already a test in place to account for this situation, but it was `xit`'ed. The proposed patch is to ask Nokogiri to find the first child element of the list, instead of the first child (which might include stuff like a newline).
- Loading branch information
1 parent
c664cad
commit 3732a3b
Showing
3 changed files
with
6 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters