lib/brief/document/structure.rb in brief-1.8.10 vs lib/brief/document/structure.rb in brief-1.8.11
- old
+ new
@@ -85,10 +85,14 @@
end
[level, [fragment]]
end
- self.fragment = Brief::Document::Section::Builder.run(mapping, low: lowest_level, high: highest_level)
+ begin
+ self.fragment = Brief::Document::Section::Builder.run(mapping, low: lowest_level, high: highest_level)
+ rescue Brief::Document::Section::BuilderError
+ @fragment
+ end
end
def levels
l = fragment.css('[data-level]').map { |el| el.attr('data-level').to_i }
l.reject!(&:nil?)