mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
commit
99cd38f8d9
@ -202,26 +202,31 @@ class Textile(object):
|
||||
(re.compile(r'{Rs}'), r'₨'), # Rupee
|
||||
(re.compile(r'{(C=|=C)}'), r'€'), # euro
|
||||
(re.compile(r'{tm}'), r'™'), # trademark
|
||||
(re.compile(r'{spade}'), r'♠'), # spade
|
||||
(re.compile(r'{club}'), r'♣'), # club
|
||||
(re.compile(r'{heart}'), r'♥'), # heart
|
||||
(re.compile(r'{diamond}'), r'♦'), # diamond
|
||||
(re.compile(r'{spades?}'), r'♠'), # spade
|
||||
(re.compile(r'{clubs?}'), r'♣'), # club
|
||||
(re.compile(r'{hearts?}'), r'♥'), # heart
|
||||
(re.compile(r'{diam(onds?|s)}'), r'♦'), # diamond
|
||||
]
|
||||
glyph_defaults = [
|
||||
(re.compile(r'(\d+\'?\"?)( ?)x( ?)(?=\d+)'), r'\1\2×\3'), # dimension sign
|
||||
(re.compile(r'(\d+)\'', re.I), r'\1′'), # prime
|
||||
(re.compile(r'(\d+)\"', re.I), r'\1″'), # prime-double
|
||||
(re.compile(r'(\')\''), r'\1’'), # single closing - following another
|
||||
(re.compile(r"(\w)\'(\w)"), r'\1’\2'), # apostrophe's
|
||||
(re.compile(r'(\s)\'(\d+\w?)\b(?!\')'), r'\1’\2'), # back in '88
|
||||
(re.compile(r'(\S)\'(?=\s|\'|<|$)'), r'\1’'), # single closing
|
||||
(re.compile(r'\'/'), r'‘'), # single opening
|
||||
(re.compile(r'(\s\[)\''), r'\1‘'), # single opening - following ws+[
|
||||
(re.compile(r'(\S)\'(?=\s|'+pnct+'|<|$)', re.M), r'\1’'), # single closing
|
||||
(re.compile(r'\''), r'‘'), # single opening
|
||||
(re.compile(r'(\")\"'), r'\1”'), # double closing - following another
|
||||
(re.compile(r'(\S)\"(?=\s|”|<|$)'), r'\1”'), # double closing
|
||||
(re.compile(r'(\s\[)\"'), r'\1“'), # double opening - following whitespace+[
|
||||
(re.compile(r'(\S)\"(?=\s|'+pnct+'|<|$)', re.M), r'\1”'), # double closing
|
||||
(re.compile(r'"'), r'“'), # double opening
|
||||
(re.compile(r'\b([A-Z][A-Z0-9]{2,})\b(?:[(]([^)]*)[)])'), r'<acronym title="\2">\1</acronym>'), # 3+ uppercase acronym
|
||||
(re.compile(r'\b([A-Z][A-Z\'\-]+[A-Z])(?=[\s.,\)>])'), r'<span class="caps">\1</span>'), # 3+ uppercase
|
||||
(re.compile(r'\b(\s{0,1})?\.{3}'), r'\1⁄'), # ellipsis
|
||||
(re.compile(r'(\s?)--(\s?)'), r'\1—\2'), # em dash
|
||||
(re.compile(r'\b(\s{0,1})?\.{3}'), r'\1…'), # ellipsis
|
||||
(re.compile(r'^[\*_-]{3,}$', re.M), r'<hr />'), # <hr> scene-break
|
||||
(re.compile(r'\b--\b'), r'—'), # em dash
|
||||
(re.compile(r'(\s)--(\s)'), r'\1—\2'), # em dash
|
||||
(re.compile(r'\s-(?:\s|$)'), r' – '), # en dash
|
||||
(re.compile(r'\b( ?)[([]TM[])]', re.I), r'\1™'), # trademark
|
||||
(re.compile(r'\b( ?)[([]R[])]', re.I), r'\1®'), # registered
|
||||
@ -747,7 +752,7 @@ class Textile(object):
|
||||
return url
|
||||
|
||||
def shelve(self, text):
|
||||
id = str(uuid.uuid4())
|
||||
id = str(uuid.uuid4()) + 'c'
|
||||
self.shelf[id] = text
|
||||
return id
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user