Patch by Adam Stein <adam@csh.rit.edu > - Partial completion of "0002513: Using section/region on media_ref as thumbnail on reports"

svn: r17917
This commit is contained in:
Brian Matherly
2011-07-12 03:30:58 +00:00
parent c9f0f2c8d7
commit bb6ad450e3
5 changed files with 76 additions and 23 deletions

View File

@@ -53,7 +53,7 @@ log = logging.getLogger(".textdoc")
# URL string pattern
#
#-------------------------------------------------------------------------
URL_PATTERN = r'''(((https?|mailto):)(//([^/?#"]*))?([^?#"]*)(\?([^#"]*))?(#([^"]*))?)'''
URL_PATTERN = r'''(((https?|mailto):)(//([^ /?#"]*))?([^ ?#"]*)(\?([^ #"]*))?(#([^ "]*))?)'''
#-------------------------------------------------------------------------
#
@@ -221,7 +221,7 @@ class TextDoc(object):
text = str(styledtext)
self.write_note(text, format, style_name)
def write_text_citation(self, text, mark=None):
def write_text_citation(self, text, mark=None, links=None):
"""
Method to write text with GRAMPS <super> citation marks.
"""
@@ -236,22 +236,22 @@ class TextDoc(object):
piecesplit = piece.split("</super>")
if len(piecesplit) == 2:
self.start_superscript()
self.write_text(piecesplit[0])
self.write_text(piecesplit[0], links=links)
self.end_superscript()
if not piecesplit[1]:
#text ended with ' ... </super>'
continue
if not markset:
self.write_text(piecesplit[1], mark)
self.write_text(piecesplit[1], mark, links=links)
markset = True
else:
self.write_text(piecesplit[1])
self.write_text(piecesplit[1], links=links)
else:
if not markset:
self.write_text(piece, mark)
self.write_text(piece, mark, links=links)
markset = True
else:
self.write_text(piece)
self.write_text(piece, links=links)
def add_media_object(self, name, align, w_cm, h_cm, alt='', style_name=None, crop=None):
"""