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

Remove most pagebreaks, improve white space handling

parent 59dd5a7d
......@@ -401,16 +401,14 @@ $log as xs:string) as node()* {
}
else if($node/@type = "pocket") then
(fontaneSimple:make-pb($node),
element tei:div{
$node/(@* except (@n, @ulx, @uly, @lry, @lrx)),
fontaneSimple:transform($node/node(), $uri, $log)
})
}
else if(simpleHelpers:is-page($node)
and $node/@type = "clipping") then
(fontaneSimple:make-pb($node),
(if($node/@subtype = "Kalenderblatt"
if($node/@subtype = "Kalenderblatt"
and contains($node//tei:handShift/@new, "Friedrich_Fontane")) then
element tei:div {
$node/@n,
......@@ -426,10 +424,10 @@ $log as xs:string) as node()* {
}
else
()))
()
else if(simpleHelpers:is-page($node)) then
(fontaneSimple:make-pb($node),
(text{" "},
fontaneSimple:transform($node/node(), $uri, $log))
else if($node/@type = "label" and
......@@ -959,13 +957,15 @@ declare function fontaneSimple:enhance-handshift($node as element(tei:handShift)
as element(tei:milestone) {
let $prev-hand := $node/preceding::tei:handShift[@new][1]
let $whitespace-before :=
if($node/preceding::node()[1][normalize-space(.) = ""]) then
if($node/preceding::node()[1][normalize-space(.) = ""]
and string-length($node/preceding::text()[1]) = 1) then
true()
else
false()
let $whitespace-after :=
if($node/following::node()[1][normalize-space(.) = ""]
and string-length($node/following::text()[1]) = 1
and not($node/following::*[1][@type = "heading"])
and not($node/following::text()[1][matches(substring(., 1, 1), "[\.,]")])) then
true()
......@@ -976,8 +976,8 @@ as element(tei:milestone) {
element tei:milestone {
attribute unit {"handshift"},
attribute subtype {if($node/@new) then $node/@new else $prev-hand/@new},
(if($whitespace-before) then attribute ws-before {"true"} else ()),
(if($whitespace-after) then attribute ws-after {"true"} else ()),
(: (if($whitespace-before) then attribute ws-before {"true"} else ()),:)
(: (if($whitespace-after) then attribute ws-after {"true"} else ()),:)
$node/(@* except @new)
}
......
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