Commit 8606c8c2 authored by MRodz's avatar MRodz Committed by mrodzis
Browse files

Fix bug in a6187015

parent 5b5c4aa2
......@@ -118,13 +118,16 @@ declare function tidySimple:make-structure($nodes as node()*) as node()* {
for $node in $nodes return
typeswitch ($node)
case text() return
if ($node/preceding::tei:milestone/@spanTo
and $node/following::tei:anchor[matches(preceding::tei:milestone/@spanTo, @xml:id)]
or $node/preceding::tei:milestone[@unit = "paragraph"]
and $node/preceding::tei:milestone[@unit = "paragraph"]) then
let $prev-section-marker := $node/preceding::tei:milestone[1][@spanTo]
let $target-id := replace($prev-section-marker, "#", "")
let $next-anchor := $node/following::tei:anchor[matches(@xml:id, $target-id)]
let $next-p := $node/following::tei:milestone[@unit = "paragraph"][1]
if($prev-section-marker and $next-anchor
or $next-p and tidySimple:is-second-part-of-pair($next-p)) then
case element(tei:milestone) return
if($node/@unit = "section") then
This diff is collapsed.
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment