mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Allow text-indent and text-align to be inherited.
This commit is contained in:
parent
e383232fe9
commit
b1ee960066
6
setup.py
6
setup.py
@ -240,6 +240,12 @@ if sys.hexversion < 0x2050000:
|
|||||||
print >> sys.stderr, "If you are using easy_install, try easy_install-2.5"
|
print >> sys.stderr, "If you are using easy_install, try easy_install-2.5"
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
try:
|
||||||
|
from PIL import Image
|
||||||
|
except ImportError:
|
||||||
|
import Image
|
||||||
|
print >>sys.stderr, "You do not have the Python Imaging Library correctly installed."
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='libprs500',
|
name='libprs500',
|
||||||
|
@ -582,7 +582,6 @@ class HTMLConverter(object):
|
|||||||
align = "foot"
|
align = "foot"
|
||||||
elif val == "center":
|
elif val == "center":
|
||||||
align = "center"
|
align = "center"
|
||||||
css.pop('text-align')
|
|
||||||
if align != self.current_block.textStyle.attrs['align']:
|
if align != self.current_block.textStyle.attrs['align']:
|
||||||
self.current_para.append_to(self.current_block)
|
self.current_para.append_to(self.current_block)
|
||||||
self.current_block.append_to(self.current_page)
|
self.current_block.append_to(self.current_page)
|
||||||
@ -616,14 +615,15 @@ class HTMLConverter(object):
|
|||||||
print >>sys.stderr, err
|
print >>sys.stderr, err
|
||||||
|
|
||||||
def sanctify_css(self, css):
|
def sanctify_css(self, css):
|
||||||
""" Make css safe for use in a SPAM Xylog tag """
|
""" Return a copy of C{css} that is safe for use in a SPAM Xylog tag """
|
||||||
|
css = copy.copy(css)
|
||||||
for key in css.keys():
|
for key in css.keys():
|
||||||
test = key.lower()
|
test = key.lower()
|
||||||
if test.startswith('margin') or \
|
if test.startswith('margin') or test.startswith('text') or \
|
||||||
'padding' in test or 'border' in test or 'page-break' in test \
|
'padding' in test or 'border' in test or 'page-break' in test \
|
||||||
or test.startswith('mso') or test.startswith('background')\
|
or test.startswith('mso') or test.startswith('background')\
|
||||||
or test in ['color', 'display', 'text-decoration', \
|
or test in ['color', 'display', \
|
||||||
'letter-spacing', 'text-autospace', 'text-transform',
|
'letter-spacing',
|
||||||
'font-variant']:
|
'font-variant']:
|
||||||
css.pop(key)
|
css.pop(key)
|
||||||
return css
|
return css
|
||||||
@ -867,7 +867,6 @@ class HTMLConverter(object):
|
|||||||
self.lstrip_toggle = True
|
self.lstrip_toggle = True
|
||||||
if tag_css.has_key('text-indent'):
|
if tag_css.has_key('text-indent'):
|
||||||
indent = Span.unit_convert(tag_css['text-indent'])
|
indent = Span.unit_convert(tag_css['text-indent'])
|
||||||
tag_css.pop('text-indent')
|
|
||||||
if not indent:
|
if not indent:
|
||||||
indent=0
|
indent=0
|
||||||
else:
|
else:
|
||||||
|
@ -70,7 +70,7 @@
|
|||||||
|
|
||||||
<h2><a name='images'>Inline images</a></h2>
|
<h2><a name='images'>Inline images</a></h2>
|
||||||
<p>
|
<p>
|
||||||
Here I demonstrate the use of inline images in the midst of text. Here is a small image <img src='small.jpg' /> embedded in a sentence. Now we have a slightly larger image that is automatically put in its own block <img src='medium.jpg' /> and finally we have a large image which is automatically placed on a page by itself and prevented from being autoscaled when the user changes from S to M to L. Try changing sizes and see how the different embedding styles behave. <img src='large.jpg' />
|
Here I demonstrate the use of inline images in the midst of text. Here is a small image <img src='small.jpg' /> embedded in a sentence. Now we have a slightly larger image that is automatically put in its own block <img style="text-align:center" src='medium.jpg' /> and finally we have a large image which is automatically placed on a page by itself and prevented from being autoscaled when the user changes from S to M to L. Try changing sizes and see how the different embedding styles behave. <img src='large.jpg' />
|
||||||
</p>
|
</p>
|
||||||
<p class='toc'>
|
<p class='toc'>
|
||||||
<hr />
|
<hr />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user