From 63cfa40372a9d33c84c0e4b61ed505173c780eae Mon Sep 17 00:00:00 2001 From: Jan Szejko Date: Thu, 3 Mar 2016 13:40:26 +0100 Subject: [PATCH] local changes from ve --- librarian/pyhtml.py | 5 ++++- librarian/pypdf.py | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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': -- 2.20.1