Mange / roadie

@@ -10,16 +10,8 @@
Loading
10 10
      dom
11 11
    end
12 12
13 -
    # JRuby up to at least 1.6.0 has a bug where the doctype of a document cannot be changed.
14 -
    # See https://github.com/sparklemotion/nokogiri/issues/984
15 -
    def pending_for_buggy_jruby
16 -
      # No reason to check for version yet since no existing version has a fix.
17 -
      skip "Pending until Nokogiri issue #984 is fixed and released" if defined?(JRuby)
18 -
    end
19 -
20 13
    describe "automatic doctype" do
21 14
      it "inserts a HTML5 doctype if no doctype is present" do
22 -
        pending_for_buggy_jruby
23 15
        expect(improve("<html></html>").internal_subset.to_xml).to eq("<!DOCTYPE html>")
24 16
      end
25 17

@@ -203,12 +203,6 @@
Loading
203 203
          result = rendering("<p></p>")
204 204
205 205
          expect(result).to have_styling([]).at_selector("p")
206 -
207 -
          # css_parser actually sees an empty @keyframes on JRuby, and nothing
208 -
          # on the others
209 -
          if (style_element = result.at_css("head > style"))
210 -
            expect(style_element.text).to_not include "background-position"
211 -
          end
212 206
        end
213 207
214 208
        it "ignores them if told not to keep them" do

@@ -11,9 +11,6 @@
Loading
11 11
  #   * `<head>`
12 12
  #   * `<body>`
13 13
  #   * `<meta>` declaring charset and content-type (text/html)
14 -
  #
15 -
  # @note Due to a Nokogiri bug, the HTML5 doctype cannot be added under JRuby. No doctype is outputted under JRuby.
16 -
  #   See https://github.com/sparklemotion/nokogiri/issues/984
17 14
  class MarkupImprover
18 15
    # The original HTML must also be passed in in order to handle the doctypes
19 16
    # since a +Nokogiri::HTML::Document+ will always have a doctype, no matter if
@@ -39,20 +36,12 @@
Loading
39 36
    private
40 37
41 38
    def ensure_doctype_present
42 -
      return if uses_buggy_jruby?
43 39
      return if @html.include?("<!DOCTYPE ")
44 40
      # Nokogiri adds a "default" doctype to the DOM, which we will remove
45 41
      dom.internal_subset&.remove
46 42
      dom.create_internal_subset "html", nil, nil
47 43
    end
48 44
49 -
    # JRuby up to at least 1.6.0 has a bug where the doctype of a document cannot be changed.
50 -
    # See https://github.com/sparklemotion/nokogiri/issues/984
51 -
    def uses_buggy_jruby?
52 -
      # No reason to check for version yet since no existing version has a fix.
53 -
      defined?(JRuby)
54 -
    end
55 -
56 45
    def ensure_html_element_present
57 46
      return if dom.at_xpath("html")
58 47
      html = Nokogiri::XML::Node.new "html", dom

@@ -58,11 +58,6 @@
Loading
58 58
59 59
  def parse_property(property)
60 60
    rule, value = property.split(":", 2).map(&:strip)
61 -
    [rule, normalize_quotes(value)]
62 -
  end
63 -
64 -
  # JRuby's Nokogiri encodes quotes
65 -
  def normalize_quotes(string)
66 -
    string.gsub "%22", '"'
61 +
    [rule, value]
67 62
  end
68 63
end

@@ -13,14 +13,7 @@
Loading
13 13
      document = Roadie::Document.new(html)
14 14
      result = document.transform
15 15
16 -
      unless defined?(JRuby)
17 -
        # JRuby has a bug that makes DTD manipulation impossible
18 -
        # See Nokogiri bugs #984 and #985
19 -
        # https://github.com/sparklemotion/nokogiri/issues/984
20 -
        # https://github.com/sparklemotion/nokogiri/issues/985
21 -
        expect(result).to include("<!DOCTYPE html>")
22 -
      end
23 -
16 +
      expect(result).to include("<!DOCTYPE html>")
24 17
      expect(result).to include("<html>")
25 18
      expect(result).to include("<head>")
26 19
      expect(result).to include("<body>")
Files Coverage
lib 98.76%
spec 97.52%
Project Totals (57 files) 97.98%
1786044939
1786044939
1786044939
1786044939

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading