diff --git a/lib/metanorma/standoc/validate.rb b/lib/metanorma/standoc/validate.rb index 6a44b88b..3ab85005 100644 --- a/lib/metanorma/standoc/validate.rb +++ b/lib/metanorma/standoc/validate.rb @@ -219,7 +219,7 @@ def repeat_id_validate(doc) # manually check for xref/@target, xref/@to integrity def xref_validate(doc) - @doc_xrefs = doc.xpath("//xref/@target | //xref/@to") + @doc_xrefs = doc.xpath("//xref/@target | //xref/@to | //index/@to") .each_with_object({}) do |x, m| m[x.text] = x @doc_ids[x.text] and next diff --git a/spec/metanorma/validate_spec.rb b/spec/metanorma/validate_spec.rb index 333d6d1d..30c2ca6e 100644 --- a/spec/metanorma/validate_spec.rb +++ b/spec/metanorma/validate_spec.rb @@ -1266,7 +1266,7 @@ .to include("Could not resolve footnoteblock:[id1]") end - it "Warning if xref/@target does not point to a real identifier" do + it "Warning if xref/@target, (xref/@to), index/@to does not point to a real identifier" do FileUtils.rm_f "test.err.html" Asciidoctor.convert(<<~INPUT, *OPTIONS) = Document title @@ -1275,9 +1275,12 @@ :no-pdf: <> + index-range:id3[(((A)))] INPUT expect(File.read("test.err.html")) .to include("Crossreference target id1 is undefined") + expect(File.read("test.err.html")) + .to include("Crossreference target id3 is undefined") end it "Warns if illegal nessting of assets within assets" do