appy.pod: bugfix in html2odt: in some situations, while using stylesMappings, some empty tags were present in the result, producing a superflous empty paragraph; bugfix while importing PNG files under Windows; appy.gen: began to implement a new global Appy-specific page template and styles.
This commit is contained in:
parent
ddec7cd62c
commit
7514eb31a9
9 changed files with 114 additions and 21 deletions
|
@ -145,7 +145,7 @@ pxToCm = 44.173513561
|
|||
def getSize(filePath, fileType):
|
||||
'''Gets the size of an image by reading first bytes.'''
|
||||
x, y = (None, None)
|
||||
f = file(filePath)
|
||||
f = file(filePath, 'rb')
|
||||
if fileType in jpgTypes:
|
||||
# Dummy read to skip header ID
|
||||
f.read(2)
|
||||
|
|
|
@ -454,6 +454,9 @@ class XhtmlParser(XmlParser):
|
|||
currentElem, elemsToReopen = e.onElementEnd(elem)
|
||||
# Determine the tag to dump
|
||||
startTag, endTag = currentElem.getOdfTags(e)
|
||||
if currentElem.isConflictual:
|
||||
# Compute the start tag, with potential styles applied
|
||||
startTag = e.getTags((currentElem,), start=True)
|
||||
if currentElem.isConflictual and e.res.endswith(startTag):
|
||||
# We will not dump it, it would constitute a silly empty tag.
|
||||
e.res = e.res[:-len(startTag)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue