Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fontane-notizbuecher
SADE
Commits
cfb5a856
Commit
cfb5a856
authored
Aug 05, 2019
by
mrodzis
💪
Browse files
Remove most pagebreaks, improve white space handling
parent
59dd5a7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/fontane/edited-text/tei2teisimple.xqm
View file @
cfb5a856
...
...
@@ -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)
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment