0
Nokogiri는 엄격한 옵션을 따르지 않는 것 같습니다.Nokogiri에게 잘못된 HTML 조각에 대한 오류를보고하거나 올리려면 어떻게해야합니까? I
html = %Q{<ul id="Test"><li></ul></li>}
parsed = Nokogiri::HTML(html) do |config|
config.strict
end
이 문서에 따라 오류가 발생한다 : 그들은 옵션을 설정하는 데 사용하는
http://www.nokogiri.org/tutorials/parsing_an_html_xml_document.html
STRICT - Strict parsing; raise an error when parsing malformed documents
코드는 이것이다 : 전에 비슷한 질문을 있었다
doc = Nokogiri::XML(File.open("blossom.xml")) do |config|
config.strict.noblanks
end
, 대답 없음 :
How can I detect errors in an HTML document fragment with Ruby?