You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by br...@apache.org on 2021/01/08 20:27:05 UTC

[allura] 02/02: py3: ensure unicode before all markup handling paths here

This is an automated email from the ASF dual-hosted git repository.

brondsem pushed a commit to branch db/py3_more_fixes
in repository https://gitbox.apache.org/repos/asf/allura.git

commit 07f998becccee8b10ecb85a02177a69167fbbe24
Author: Dave Brondsema <db...@slashdotmedia.com>
AuthorDate: Fri Jan 8 15:26:39 2021 -0500

    py3: ensure unicode before all markup handling paths here
---
 Allura/allura/lib/helpers.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/Allura/allura/lib/helpers.py b/Allura/allura/lib/helpers.py
index 8773279..8a526b6 100644
--- a/Allura/allura/lib/helpers.py
+++ b/Allura/allura/lib/helpers.py
@@ -763,7 +763,7 @@ TABLE = 'table'
 
 def render_any_markup(name, txt, code_mode=False, linenumbers_style=TABLE):
     """
-    renders markdown using allura enhacements if file is in markdown format
+    renders markdown using allura enhancements if file is in markdown format
     renders any other markup format using the pypeline
     Returns jinja-safe text
     """
@@ -771,8 +771,9 @@ def render_any_markup(name, txt, code_mode=False, linenumbers_style=TABLE):
         txt = '<p><em>Empty File</em></p>'
     else:
         fmt = g.pypeline_markup.can_render(name)
+        txt = really_unicode(txt)
         if fmt == 'markdown':
-            txt = g.markdown.convert(really_unicode(txt))
+            txt = g.markdown.convert(txt)
         else:
             txt = g.pypeline_markup.render(name, txt)
         if not fmt: