From 6f4be261ef19eb1b00f77f7d63665b2a03340683 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Wed, 18 Apr 2012 17:54:42 -0500 Subject: [PATCH] Fix Japanese in CLI & web version. Broke it in 443 and didn't notice. --- fanficdownloader/adapters/adapter_test1.py | 4 ++-- fanficdownloader/htmlcleanup.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fanficdownloader/adapters/adapter_test1.py b/fanficdownloader/adapters/adapter_test1.py index 0d5cb10..0496227 100644 --- a/fanficdownloader/adapters/adapter_test1.py +++ b/fanficdownloader/adapters/adapter_test1.py @@ -179,9 +179,9 @@ Some more longer description. "I suck at summaries!" "Better than it sounds!"

Chapter title from site

Centered text

-

Lorem '''+self.crazystring+''' italics, bold, underline consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

+

Lorem '''+self.crazystring+u''' italics, bold, underline consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

br breaks

- +Puella Magi Madoka Magica/魔法少女まどか★マギカ
br breaks


diff --git a/fanficdownloader/htmlcleanup.py b/fanficdownloader/htmlcleanup.py index 2e223e7..2bf4280 100644 --- a/fanficdownloader/htmlcleanup.py +++ b/fanficdownloader/htmlcleanup.py @@ -32,7 +32,8 @@ def _replaceNumberEntities(data): # entities, including part of the next word if it's a-z. # "Don't—ever—do—that—again," becomes # "Don't—e;ver—d;o—that—a;gain," - p = re.compile(r'&#(x?)([0-9a-fA-F]{,4})([0-9a-fA-F]*);') + # Also need to allow for 5 digit decimal entities 法 + p = re.compile(r'&#(x?)([0-9]{,5}|[0-9a-fA-F]{,4})([0-9a-fA-F]*?);') return p.sub(_unirepl, data) def _replaceNotEntities(data):