Skip to content

Commit

Permalink
HtmlToText no longer makes the array unique
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeltelford committed Oct 17, 2024
1 parent d3e5cc7 commit 803fb91
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/wgit/html_to_text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ def extract_arr
.split("\n")
.map(&:strip)
.reject(&:empty?)
.uniq
end

# Extracts and returns a text string from the @parser HTML.
Expand Down
13 changes: 13 additions & 0 deletions test/test_html_to_text.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,19 @@ def test_extract__getting_started_wiki
], doc.text
end

def test_extract__dups_are_not_removed
doc = Wgit::Document.new "http://www.mytestsite.com/home", <<~HTML
<p>Note: The text search index lists all document fields.</p>
<hr>
<p>Note: The text search index lists all document fields.</p>
HTML

assert_equal [
"Note: The text search index lists all document fields.",
"Note: The text search index lists all document fields."
], doc.text
end

private

def gsub_use_case_content(use_case, content)
Expand Down

0 comments on commit 803fb91

Please sign in to comment.