From: Jan Szejko Date: Thu, 3 Mar 2016 12:40:26 +0000 (+0100) Subject: local changes from ve X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/63cfa40372a9d33c84c0e4b61ed505173c780eae?ds=inline local changes from ve --- diff --git a/librarian/pyhtml.py b/librarian/pyhtml.py index 9264c15..1043f4f 100644 --- a/librarian/pyhtml.py +++ b/librarian/pyhtml.py @@ -231,7 +231,10 @@ u"""%(wskazowki)s # let's pull definiens from another document if self.options['slowniczek_xml'] is not None and (nxt is None or nxt.tag != 'definiens'): sxml = self.options['slowniczek_xml'] - defloc = sxml.xpath("//definiendum[text()='%s']" % element.text) + if "'" in (element.text or ''): + defloc = sxml.xpath("//definiendum[text()=\"%s\"]" % (element.text or '').strip()) + else: + defloc = sxml.xpath("//definiendum[text()='%s']" % (element.text or '').strip()) if defloc: definiens = defloc[0].getnext() if definiens.tag == 'definiens': diff --git a/librarian/pypdf.py b/librarian/pypdf.py index 759e1f3..b99f6ad 100644 --- a/librarian/pypdf.py +++ b/librarian/pypdf.py @@ -350,7 +350,10 @@ class EduModule(Xmill): if self.options['slowniczek_xml'] is not None and (nxt is None or nxt.tag != 'definiens'): sxml = self.options['slowniczek_xml'] assert element.text != '' - defloc = sxml.xpath("//definiendum[text()='%s']" % element.text) + if "'" in (element.text or ''): + defloc = sxml.xpath("//definiendum[text()=\"%s\"]" % (element.text or '').strip()) + else: + defloc = sxml.xpath("//definiendum[text()='%s']" % (element.text or '').strip()) if defloc: definiens = defloc[0].getnext() if definiens.tag == 'definiens':