Commit 50be11b0 authored by MRodz's avatar MRodz Committed by mrodzis
Browse files

Add first draft for 3.21.19 underline

parent 258ad594
......@@ -137,7 +137,7 @@ declare
(: marking something as complete :)
%test:args("<zone xmlns=""http://www.tei-c.org/ns/1.0"" type=""marked_off"" xml:id=""E04_39r_2"" uly=""0.5""><line xmlns=""http://www.tei-c.org/ns/1.0""><hi xmlns=""http://www.tei-c.org/ns/1.0"">3<seg xmlns=""http://www.tei-c.org/ns/1.0"" style=""text-decoration:underline"">. Kapitel</seg></hi>.</line></zone>")
%test:assertEquals("<seg xmlns=""http://www.tei-c.org/ns/1.0"" type=""marked_off"" xml:id=""E04_39r_2"">3<seg xmlns=""http://www.tei-c.org/ns/1.0"" style=""text-decoration:underline"">. Kapitel</seg>.</seg>")
%test:assertEquals("<seg xmlns=""http://www.tei-c.org/ns/1.0"" type=""marked_off"" xml:id=""E04_39r_2""><hi xmlns=""http://www.tei-c.org/ns/1.0"">3. Kapitel</hi>.</seg>")
function teisimple-test:analyze-del($node as element(*)) {
fontane-simple:transform($node)
......@@ -516,4 +516,14 @@ declare
function teisimple-test:analyze-insertions($node as element(*)) {
fontane-simple:transform($node)
};
(: 3.21.19 UNDERLINE :)
declare
%test:name("Underline")
%test:args("<hi xmlns=""http://www.tei-c.org/ns/1.0"">K<mod xmlns=""http://www.tei-c.org/ns/1.0"" style=""text-decoration:underline"" rend=""underline-style:retrace"">aiſer</mod></hi>")
%test:assertEquals("<hi xmlns=""http://www.tei-c.org/ns/1.0"">Kaiſer</hi>")
function teisimple-test:analyze-underline($node as element(*)) {
fontane-simple:transform($node)
};
\ No newline at end of file
......@@ -173,9 +173,11 @@ declare function fontane-simple:transform($nodes as node()*) as node()* {
case element(tei:seg)
return
if(count($node/*) = 1 and
($node/child::tei:stampor or $node/child::tei:metamark[@function = "caret"]))
($node/child::tei:stamp or $node/child::tei:metamark[@function = "caret"]))
then
()
else if(matches($node/@style, "underline")) then
fontane-simple:transform($node/node())
else if($node/@type = "initials" or $node/@type = "monogram"
or $node/@style or $node/@type = "multiphrase")
then
......@@ -190,6 +192,11 @@ declare function fontane-simple:transform($nodes as node()*) as node()* {
()
else
fontane-simple:transform($node/node())
case element(tei:hi) return
element tei:hi {
fontane-simple:transform($node/node())
}
case element(tei:anchor) return
$node
......
This diff is collapsed.
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