Skip to content

Commit

Permalink
Merge pull request #596 from metanorma/fix/security-202408
Browse files Browse the repository at this point in the history
rspec
  • Loading branch information
opoudjis authored Aug 23, 2024
2 parents d815d06 + 76f7b95 commit 1d98089
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/isodoc/gem_tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def process_css_files(scss_files)

def comment_out_liquid(text)
text.split("\n").map do |line|
if line.match?(/(?<!{){({|%)(?!{).+(}|%)}/)
if line.match?(/(?<!{){({|%)(?![{%]).+(}|%)}/)
"/* LIQUID_COMMENT#{line}LIQUID_COMMENT */"
else
line
Expand Down
2 changes: 1 addition & 1 deletion spec/isodoc/gem_tasks_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

it "test build deps has build_scss" do
build_deps = Rake::Task["build"].all_prerequisite_tasks.map(&:name)
expect(build_deps).to include "build_scss"
expect(build_deps).to include("build_scss")
end

it "test generate/clean CSS" do
Expand Down
10 changes: 5 additions & 5 deletions spec/isodoc/postproc_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
expect(html).to match(/another empty stylesheet/)
expect(html).to match(%r{https://use\.fontawesome\.com})
expect(html).to match(%r{libs/jquery})
expect(html).to include "$('#toggle')"
expect(html).to include("$('#toggle')")
expect(html).not_to match(/CDATA/)
end

Expand Down Expand Up @@ -1375,13 +1375,13 @@
.convert("test", input, false)
expect(File.exist?("test.html")).to be true
html = File.read("test.html")
expect(html).to include "&#x3c;X&#x3e;"
expect(html).not_to include "&lt;X&gt;"
expect(html).to include("&#x3c;X&#x3e;")
expect(html).not_to include("&lt;X&gt;")
IsoDoc::WordConvert.new({ wordstylesheet: "spec/assets/word.css" })
.convert("test", input, false)
expect(File.exist?("test.doc")).to be true
html = File.read("test.doc")
expect(html).not_to include "&#x3c;X&#x3e;"
expect(html).to include "&lt;X&gt;"
expect(html).not_to include("&#x3c;X&#x3e;")
expect(html).to include("&lt;X&gt;")
end
end
12 changes: 6 additions & 6 deletions spec/isodoc/postproc_word_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@
toclevel = <<~TOCLEVEL
function toclevel() { return "h1:not(:empty):not(.TermNum):not(.noTOC),h2:not(:empty):not(.TermNum):not(.noTOC),h3:not(:empty):not(.TermNum):not(.noTOC)";}
TOCLEVEL
expect(html).to include toclevel
expect(html).to include(toclevel)
end

it "creates continuation styles for multiparagraph list items in Word" do
Expand Down Expand Up @@ -877,11 +877,11 @@
INPUT
expect(File.exist?("test.doc")).to be true
html = File.read("test.doc", encoding: "UTF-8")
expect(html).to include "div.WordSection2_0 {page:WordSection2P;}"
expect(html).to include "div.WordSection2_1 {page:WordSection2L;}"
expect(html).to include "div.WordSection3_0 {page:WordSection3P;}"
expect(html).to include "div.WordSection3_1 {page:WordSection3P;}"
expect(html).to include "div.WordSection3_2 {page:WordSection3L;}"
expect(html).to include("div.WordSection2_0 {page:WordSection2P;}")
expect(html).to include("div.WordSection2_1 {page:WordSection2L;}")
expect(html).to include("div.WordSection3_0 {page:WordSection3P;}")
expect(html).to include("div.WordSection3_1 {page:WordSection3P;}")
expect(html).to include("div.WordSection3_2 {page:WordSection3L;}")

expect(Xml::C14n.format(html.sub(/^.*<body /m, "<body ")
.sub(%r{</body>.*$}m, "</body>"))).to be_equivalent_to Xml::C14n.format(<<~OUTPUT)
Expand Down
2 changes: 1 addition & 1 deletion spec/isodoc/presentation_xml_metadata_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@
.convert("test", input, false)
expect(File.exist?("_test_attachments/spec_helper.rb")).to be true
expect(File.read("_test_attachments/spec_helper.rb"))
.to include "VCR.configure"
.to include("VCR.configure")
end

private
Expand Down

0 comments on commit 1d98089

Please sign in to comment.