0001863: <gramps> tags in notes, consistency. This should be in all notes or only in the ones that have markup
Markup has been disabled for notes. A new strategy is being worked on to allow styles for notes. svn: r10230
This commit is contained in:
@@ -41,7 +41,7 @@ from gen.lib.primaryobj import BasicPrimaryObject
|
||||
from gen.lib.notetype import NoteType
|
||||
from gen.lib.markertype import MarkerType
|
||||
|
||||
ROOT_START_TAG = '<gramps>'
|
||||
#ROOT_START_TAG = '<gramps>'
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@@ -96,7 +96,7 @@ class Note(BasicPrimaryObject):
|
||||
@return: Returns the list of all textual attributes of the object.
|
||||
@rtype: list
|
||||
"""
|
||||
return [self.delete_tags(self.text)]
|
||||
return [self.text]
|
||||
|
||||
def set(self, text):
|
||||
"""
|
||||
@@ -117,29 +117,29 @@ class Note(BasicPrimaryObject):
|
||||
@rtype: str
|
||||
"""
|
||||
text = self.text
|
||||
|
||||
if not markup and text.startswith(ROOT_START_TAG):
|
||||
text = self.delete_tags(text)
|
||||
|
||||
return text
|
||||
|
||||
def delete_tags(self, markup_text):
|
||||
"""
|
||||
Create a plain text version of the note text by removing all pango
|
||||
markup tags.
|
||||
|
||||
@param markup_text: Pango style markup text
|
||||
@type markup_text: str
|
||||
@return: Plain text
|
||||
@rtype: str
|
||||
"""
|
||||
text = re.sub(r'(<.*?>)', '', markup_text)
|
||||
|
||||
text = text.replace('&', '&')
|
||||
text = text.replace('<', '<')
|
||||
text = text.replace('>', '>')
|
||||
#
|
||||
# if not markup and text.startswith(ROOT_START_TAG):
|
||||
# text = self.delete_tags(text)
|
||||
|
||||
return text
|
||||
#
|
||||
# def delete_tags(self, markup_text):
|
||||
# """
|
||||
# Create a plain text version of the note text by removing all pango
|
||||
# markup tags.
|
||||
#
|
||||
# @param markup_text: Pango style markup text
|
||||
# @type markup_text: str
|
||||
# @return: Plain text
|
||||
# @rtype: str
|
||||
# """
|
||||
# text = re.sub(r'(<.*?>)', '', markup_text)
|
||||
#
|
||||
# text = text.replace('&', '&')
|
||||
# text = text.replace('<', '<')
|
||||
# text = text.replace('>', '>')
|
||||
#
|
||||
# return text
|
||||
|
||||
def append(self, text):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user