Commit b7e02afa authored by mrodzis's avatar mrodzis 🌿
Browse files

Adapt whitespace handling

parent 37911e67
......@@ -327,26 +327,10 @@ declare function tidySimple:whitespaces($nodes as node()*) as node()* {
let $target-id := replace($node/@next, "#", "")
let $target := $node/ancestor::tei:text//*[@xml:id = $target-id]
return
(if(not(ends-with($node//text()[last()], "@P"))
and ($node/following::*[. << $target][self::tei:milestone[@unit = "line"]]
or $target/following::*[. << $node][self::tei:milestone[@unit = "line"]])) then
if(not(ends-with($node//text()[last()], "@P"))) then
attribute break {"true"}
else
(),
if($node/following::text()[. << $target][not(normalize-space(.) = "")]
or $target/following::text()[. << $node][not(normalize-space(.) = "")]) then
attribute text-inbetween {"true"}
else
())
else if($node/@prev) then
let $target-id := replace($node/@prev, "#", "")
let $target := $node/ancestor::tei:text//*[@xml:id = $target-id]
return
if($node/following::text()[. << $target][not(normalize-space(.) = "")]
or $target/following::text()[. << $node][not(normalize-space(.) = "")]) then
attribute text-inbetween {"true"}
else
()
()
else
(),
tidySimple:whitespaces($node/node())
......
Markdown is supported
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