incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [1/3] git commit: [#5634] ticket:333 fixed html comments in markdown
Date Wed, 15 May 2013 15:55:33 GMT
Updated Branches:
  refs/heads/master 5f41cdae2 -> 78e97ac49


[#5634]  ticket:333 fixed  html comments in markdown


Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/92243243
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/92243243
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/92243243

Branch: refs/heads/master
Commit: 922432431f2f3abf72d1ce20613397ba07367954
Parents: 5f41cda
Author: Yuriy Arhipov <yuriyarhipovua@yandex.ru>
Authored: Wed May 8 13:56:12 2013 +0400
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Wed May 15 15:44:03 2013 +0000

----------------------------------------------------------------------
 Allura/allura/lib/markdown_extensions.py |    2 +-
 Allura/allura/tests/test_globals.py      |    4 ++++
 2 files changed, 5 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/92243243/Allura/allura/lib/markdown_extensions.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/markdown_extensions.py b/Allura/allura/lib/markdown_extensions.py
index 942e944..62b7fe9 100644
--- a/Allura/allura/lib/markdown_extensions.py
+++ b/Allura/allura/lib/markdown_extensions.py
@@ -252,7 +252,7 @@ class RelativeLinkRewriter(markdown.postprocessors.Postprocessor):
             rewrite(link, 'href')
         for link in soup.findAll('img'):
             rewrite(link, 'src')
-        return unicode(soup)
+        return unicode(str(soup), "utf-8" )
 
     def _rewrite(self, tag, attr):
         val = tag.get(attr)

http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/92243243/Allura/allura/tests/test_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/tests/test_globals.py b/Allura/allura/tests/test_globals.py
index bf17979..71629ed 100644
--- a/Allura/allura/tests/test_globals.py
+++ b/Allura/allura/tests/test_globals.py
@@ -282,6 +282,10 @@ def test_markdown_within_html():
 <p><strong>blah</strong></p>
 </div>''' in r, r
 
+def test_markdown_with_html_comments():
+    text = g.markdown.convert('test <!-- comment -->')
+    assert '<div class="markdown_content"><p>test <!-- comment --></p></div>'
== text, text
+
 
 def test_markdown_big_text():
     '''If text is too big g.markdown.convert should return plain text'''


Mime
View raw message