mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-06 04:55:02 +01:00
PDF Input: Fix < and > in the text not being correctly handled
This commit is contained in:
parent
b0fe64571e
commit
05834f0b42
1 changed files with 2 additions and 2 deletions
|
|
@ -11,7 +11,7 @@
|
|||
import subprocess
|
||||
import sys
|
||||
|
||||
from calibre import CurrentDir, replace_entities, prints
|
||||
from calibre import CurrentDir, xml_replace_entities, prints
|
||||
from calibre.constants import (
|
||||
filesystem_encoding, isbsd, islinux, isosx, ispy3, iswindows
|
||||
)
|
||||
|
|
@ -106,7 +106,7 @@ def a(x):
|
|||
raw = re.sub(r'<a\s+name=(\d+)', r'<a id="\1"', raw, flags=re.I)
|
||||
raw = re.sub(r'<a id="(\d+)"', r'<a id="p\1"', raw, flags=re.I)
|
||||
raw = re.sub(r'<a href="index.html#(\d+)"', r'<a href="#p\1"', raw, flags=re.I)
|
||||
raw = replace_entities(raw)
|
||||
raw = xml_replace_entities(raw)
|
||||
raw = raw.replace('\u00a0', ' ')
|
||||
|
||||
i.write(raw.encode('utf-8'))
|
||||
|
|
|
|||
Loading…
Reference in a new issue