Edgewall Software
Modify

Opened 5 years ago

Closed 5 years ago

#13177 closed task (fixed)

Release Trac 1.3.6

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.3.6
Component: general Version:
Severity: normal Keywords: release
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Ryan J Ollos)

This ticket is used to coordinate the finalization and testing of the next development-stable release of Trac, 1.3.6.

Attachments (0)

Change History (7)

comment:1 by Ryan J Ollos, 5 years ago

Description: modified (diff)
Milestone: 1.3.51.3.6
Summary: Release Trac 1.3.5Release Trac 1.3.6

comment:2 by Ryan J Ollos, 5 years ago

On the trunk, the replace function isn't effectively stripping out the span tags: trunk/contrib/wiki2rst.py@16978:68#L63. See trunk/INSTALL.rst.

html is a markupsafe.Markup object. I'm not sure that this is the best way to fix it, but it seems to work:

  • contrib/wiki2rst.py

    diff --git a/contrib/wiki2rst.py b/contrib/wiki2rst.py
    index 40fd93e0f..7a611fd13 100755
    a b def wiki2rest(env, context, wiki):  
    6464    text = re.sub('\r?\n', '\n', wiki.text)
    6565    text = re.sub(r'\[\[TracGuideToc\]\]\r?\n?', '', text)
    6666    text = re.sub(r'\[\[PageOutline\([^\)]*\)\]\]\r?\n?', '', text)
    67     html = format_to_html(env, context, text)
     67    html = format_to_html(env, context, text).unescape()
    6868    html = html.replace(u'<span class="icon">\u200b</span>', '')
    6969    html = re.sub(r'<em>\s*([^<]*?)\s*</em>', r'<em>\1</em>', html)
    7070    html = '<html><body>%s</body></html>' % html

Thoughts?

Last edited 5 years ago by Ryan J Ollos (previous) (diff)

in reply to:  2 comment:3 by Ryan J Ollos, 5 years ago

Replying to Ryan J Ollos:

On the trunk, the replace function isn't effectively stripping out the span tags: trunk/contrib/wiki2rst.py@16978:68#L63. See trunk/INSTALL.rst.

This will be addressed in #12835.

Last edited 5 years ago by Ryan J Ollos (previous) (diff)

comment:4 by Ryan J Ollos, 5 years ago

Owner: set to Ryan J Ollos
Status: newassigned

I'll create the release in a few days once the remaining 4 issues are resolved.

in reply to:  2 comment:5 by Jun Omae, 5 years ago

html is a markupsafe.Markup object. I'm not sure that this is the best way to fix it, but it seems to work:

It seems we should convert from a Markup instance to a unicode instance, otherwise a Markup instance should be passed to replace().

>>> from markupsafe import Markup
>>> v = Markup('<span>xxxx</span>')
>>> v
Markup(u'<span>xxxx</span>')
>>> unicode(v).replace(u'<span>xxxx</span>', '')
u''
>>> v.replace(Markup(u'<span>xxxx</span>'), '')
Markup(u'')

I think it it easy to convert to a unicode instance.

  • contrib/wiki2rst.py

    diff --git a/contrib/wiki2rst.py b/contrib/wiki2rst.py
    index 722bef338..e8317113e 100755
    a b def wiki2rest(env, context, wiki):  
    6464    text = re.sub('\r?\n', '\n', wiki.text)
    6565    text = re.sub(r'\[\[TracGuideToc\]\]\r?\n?', '', text)
    6666    text = re.sub(r'\[\[PageOutline\([^\)]*\)\]\]\r?\n?', '', text)
    67     html = format_to_html(env, context, text)
    68     html = html.unescape().replace(u'<span class="icon">\u200b</span>', '')
     67    html = unicode(format_to_html(env, context, text))
     68    html = html.replace(u'<span class="icon">\u200b</span>', '')
    6969    html = re.sub(r'<em>\s*([^<]*?)\s*</em>', r'<em>\1</em>', html)
    7070    html = '<html><body>%s</body></html>' % html
    7171    writer = io.BytesIO()

comment:6 by Ryan J Ollos, 5 years ago

Thanks, that fixes removal of bracketed text that I didn't notice when using unescape.

Committed to trunk in r17075.

comment:7 by Ryan J Ollos, 5 years ago

Resolution: fixed
Status: assignedclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.