-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use nokogiri's HTML5 parser for text nodes (#129)
* use nokogiri's HTML5 parser for text nodes * bump up version
- Loading branch information
1 parent
9a68b0f
commit 66f2633
Showing
6 changed files
with
59 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module ODFReport | ||
VERSION = "0.7.3" | ||
VERSION = "0.8.0" | ||
end |
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
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
RSpec.describe "Texts" do | ||
before(:context) do | ||
|
||
@text1 = <<-HTML | ||
<p>This is some text in a paragraph</p> | ||
HTML | ||
|
||
@text2 = <<-HTML | ||
<p>Text before line break <br> text after line break</p> | ||
HTML | ||
|
||
@text3 = <<-HTML | ||
<p>Text before entities | ||
Maurício | ||
Text after entities</p> | ||
HTML | ||
|
||
|
||
report = ODFReport::Report.new("spec/templates/specs.odt") do |r| | ||
|
||
r.add_text(:text1, @text1) | ||
r.add_text(:text2, @text2) | ||
r.add_text(:text3, @text3) | ||
|
||
end | ||
|
||
report.generate("spec/result/specs.odt") | ||
|
||
@data = Inspector.new("spec/result/specs.odt") | ||
|
||
end | ||
|
||
it "simple text replacement" do | ||
expect(@data.text).to include "This is some text in a paragraph" | ||
end | ||
|
||
it "text replacement with <br>" do | ||
expect(@data.text).to include "Text before line break" | ||
expect(@data.text).to include "text after line break" | ||
end | ||
|
||
it "text replacement with html entities" do | ||
expect(@data.text).to include "Text before entities" | ||
expect(@data.text).to include "Maurício" | ||
expect(@data.text).to include "Text after entities" | ||
end | ||
|
||
end |