fnp
/
librarian.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
use dejavu serif for cyrrylic
[librarian.git]
/
librarian
/
pdf.py
diff --git
a/librarian/pdf.py
b/librarian/pdf.py
index
2d45372
..
07272f2
100644
(file)
--- a/
librarian/pdf.py
+++ b/
librarian/pdf.py
@@
-282,7
+282,10
@@
def load_including_children(provider, slug=None, uri=None, file_path=None):
else:
raise ValueError('Neither slug, URI nor file path provided for a book.')
else:
raise ValueError('Neither slug, URI nor file path provided for a book.')
- document = WLDocument.from_file(f, True,
+ text = f.read().decode('utf-8')
+ text = re.sub(ur"([\u0400-\u04ff]+)", ur"<alien>\1</alien>", text)
+
+ document = WLDocument.from_string(text, True,
parse_dublincore=True)
f.close()
parse_dublincore=True)
f.close()