Skip to content
Snippets Groups Projects
Commit 57d57e7f authored by Michelle Rodzis's avatar Michelle Rodzis
Browse files

improved whitespace handling

parent e02515ac
No related branches found
No related tags found
No related merge requests found
......@@ -198,9 +198,6 @@ declare function pre:preprocessing
case element(pb) return (
let $preceding-sibling := $node/preceding-sibling::node()[1]
let $following-sibling := $node/following-sibling::node()[1]
let $following-element := $node/following::*[1]
let $first := $node = $node/parent::node()/node()[not(self::text() and normalize-space(self::node()) = '')][1]
let $ignore := ("docAuthor", "app", "index", "seg", "bibl")
return
element {$node/name()}{
$node/@*,
......@@ -210,13 +207,6 @@ declare function pre:preprocessing
and
( $following-sibling[self::text() and not(normalize-space(.) = '')] and starts-with($following-sibling, " ") = false() )
) then ( attribute {"break"}{"no"} )
(:else if (
( $preceeding-sibling[self::text() and not(normalize-space(.) = '')] and ends-with($preceeding-sibling, " ") = true() )
and
( $following-sibling[self::text() and not(normalize-space(.) = '')] and starts-with($following-sibling, " ") = true() )
) then ( attribute {"clear"}{"left"} ) :)
else if (
( $preceding-sibling[matches(., "[\s\n\r\t]") and normalize-space(.) = ""] )
and
......@@ -271,7 +261,7 @@ declare function pre:preprocessing
}
)
else (
pre:default-element( $node, pre:preprocessing($node/node()) )
whitespace:set-additional-whitespace($node) )
)
)
......
......@@ -38,7 +38,7 @@ declare function whitespace:text
if ( not($whitespace-node) or $single-whitespace-between-nodes) then (
if ($escape-char) then (
whitespace:escape-text($text, "#")
whitespace:escape-text($text, "@")
) else ( whitespace:escape-text($text, " ") )
)
......@@ -87,7 +87,7 @@ declare function whitespace:set-additional-whitespace($node as node()) as node()
(if($following-node[matches(., "[\s\n\r\t]") and normalize-space(.) = ""]
and $following-sibling[self::ref or self::app or self::hi or self::bibl
or self::foreign or self::choice or self::milestone or self::persName
or self::choice or self::index])
or self::choice or self::index or self::seg])
then
attribute {"break-after"}{"yes"}
else ()),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment