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
c3f3eb17
Commit
c3f3eb17
authored
Nov 16, 2018
by
mrodzis
💪
Browse files
Fix bug in sorting out elements (cf. print#21)
parent
f0f2a121
Changes
1
Hide whitespace changes
Inline
Side-by-side
modules/fontane/teisimpleprint/tidysimple.xqm
View file @
c3f3eb17
...
...
@@ -80,10 +80,25 @@ as node()* {
default return
let $prev-handshift := $node/preceding::tei:milestone[@unit = "handshift"][1]
let $first-child-handshift := $node/child::tei:milestone[@unit = "handshift"][1]
let $first-child-element := $node/child::*[1]
let $first-child-node := $node/child::node()[1]
return
if($prev-handshift
(: in some cases the valid handshift is the first child node
instead of a previous node. of course we want to keep the element
then :)
if($first-child-element = $first-child-handshift
(: ensure there's no text before the handshift :)
and (normalize-space($first-child-node) = ""
or $first-child-element = $first-child-node)
and simpleHelpers:is-hand-valid($tidySimple:valid-hands, $first-child-handshift)) then
tidySimple:copy-element($node, "post")
else if($prev-handshift
and not(simpleHelpers:is-hand-valid($tidySimple:valid-hands, $prev-handshift))) then
()
else
tidySimple:copy-element($node, "post")
};
...
...
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