mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-05 21:43:42 +02:00
...
This commit is contained in:
commit
b25ba3ab43
2 changed files with 6 additions and 2 deletions
|
|
@ -224,6 +224,10 @@ def dehyphenate(self, match):
|
|||
return firsthalf+u'\u2014'+wraptags+secondhalf
|
||||
|
||||
else:
|
||||
if self.format == 'individual_words' and len(firsthalf) + len(secondhalf) <= 6:
|
||||
if self.verbose > 2:
|
||||
self.log("too short, returned hyphenated word: " + str(hyphenated))
|
||||
return hyphenated
|
||||
if len(firsthalf) <= 2 and len(secondhalf) <= 2:
|
||||
if self.verbose > 2:
|
||||
self.log("too short, returned hyphenated word: " + str(hyphenated))
|
||||
|
|
|
|||
|
|
@ -175,9 +175,9 @@ def detect_formatting_type(txt):
|
|||
# Block quote.
|
||||
textile_count += len(re.findall(r'(?mu)^bq\.', txt))
|
||||
# Images
|
||||
textile_count += len(re.findall(r'\![^\s]+(:[^\s]+)*', txt))
|
||||
textile_count += len(re.findall(r'\![^\s]+(?=.*?/)(:[^\s]+)*', txt))
|
||||
# Links
|
||||
textile_count += len(re.findall(r'"(\(.+?\))*[^\(]+?(\(.+?\))*":[^\s]+', txt))
|
||||
textile_count += len(re.findall(r'"(?=".*?\()(\(.+?\))*[^\(]+?(\(.+?\))*":[^\s]+', txt))
|
||||
|
||||
if markdown_count > 5 or textile_count > 5:
|
||||
if markdown_count > textile_count:
|
||||
|
|
|
|||
Loading…
Reference in a new issue