equal
deleted
inserted
replaced
11 val update_elements: Markup.Elements = |
11 val update_elements: Markup.Elements = |
12 Markup.Elements(Markup.UPDATE, Markup.LANGUAGE) |
12 Markup.Elements(Markup.UPDATE, Markup.LANGUAGE) |
13 |
13 |
14 def update_xml(options: Options, xml: XML.Body): XML.Body = { |
14 def update_xml(options: Options, xml: XML.Body): XML.Body = { |
15 val update_path_cartouches = options.bool("update_path_cartouches") |
15 val update_path_cartouches = options.bool("update_path_cartouches") |
16 val update_cite_commands = options.bool("update_cite_commands") |
16 val update_cite = options.bool("update_cite") |
17 |
17 |
18 def upd(lang: Markup.Language, ts: XML.Body): XML.Body = |
18 def upd(lang: Markup.Language, ts: XML.Body): XML.Body = |
19 ts flatMap { |
19 ts flatMap { |
20 case XML.Wrapped_Elem(markup, body1, body2) => |
20 case XML.Wrapped_Elem(markup, body1, body2) => |
21 val body = if (markup.name == Markup.UPDATE) body1 else body2 |
21 val body = if (markup.name == Markup.UPDATE) body1 else body2 |
28 } |
28 } |
29 } |
29 } |
30 else upd(lang1, body) |
30 else upd(lang1, body) |
31 case XML.Elem(_, body) => upd(lang, body) |
31 case XML.Elem(_, body) => upd(lang, body) |
32 case XML.Text(s) |
32 case XML.Text(s) |
33 if update_cite_commands && (lang.is_document || lang.is_antiquotation) => |
33 if update_cite && (lang.is_document || lang.is_antiquotation) => |
34 List(XML.Text(Bibtex.update_cite(s))) |
34 List(XML.Text(Bibtex.update_cite(s))) |
35 case t => List(t) |
35 case t => List(t) |
36 } |
36 } |
37 upd(Markup.Language.outer, xml) |
37 upd(Markup.Language.outer, xml) |
38 } |
38 } |