Skip to content

Commit bdd89df

Browse files
committed
Update script and example for unescaping HTML.
1 parent e351116 commit bdd89df

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

common/extract-examples.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,7 @@ def save_example(examples:, element:, title:, example_number:, error:, warn:)
336336
next
337337
end
338338
when 'table'
339-
doc = Nokogiri::HTML.parse(content) {|c| c.strict}
340-
content = CGI.unescapeHTML(doc.inner_html)
339+
content = Nokogiri::HTML.parse(content)
341340
when 'ttl', 'trig'
342341
begin
343342
reader_errors = []
@@ -554,8 +553,7 @@ def save_example(examples:, element:, title:, example_number:, error:, warn:)
554553
$stderr.puts "expected:\n" + expected.to_trig if verbose
555554
when 'table'
556555
expected = begin
557-
doc = Nokogiri::HTML.parse(content)
558-
table_to_dataset(doc)
556+
table_to_dataset(content.xpath('/html/body/table'))
559557
rescue
560558
errors << "Example #{ex[:number]} at line #{ex[:line]} raised error reading table: #{$!}"
561559
RDF::Dataset.new

index.html

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8609,15 +8609,13 @@ <h3>Graph Containers</h3>
86098609
<head>
86108610
<base href="http://dbpedia.org/resource/"/>****
86118611
<script type="application/ld+json">
8612-
< ! - -
86138612
{
86148613
"@context": "https://json-ld.org/contexts/person.jsonld",
86158614
"@id": ****"John_Lennon"****,
86168615
"name": "John Lennon",
86178616
"born": "1940-10-09",
86188617
"spouse": ****"Cynthia_Lennon"****
86198618
}
8620-
- - >
86218619
</script>
86228620
****</head>
86238621
</html>****

0 commit comments

Comments
 (0)