allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hei...@apache.org
Subject allura git commit: [#7889] Add parameter to bypass the limit for markdown conversion
Date Mon, 15 Jun 2015 17:40:27 GMT
Repository: allura
Updated Branches:
  refs/heads/hs/7889 [created] 4273855b0


[#7889] Add parameter to bypass the limit for markdown conversion


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

Branch: refs/heads/hs/7889
Commit: 4273855b0371758c6511d79de0a8faaa55d36b90
Parents: 195c0b1
Author: Heith Seewald <hseewald@slashdotmedia.com>
Authored: Mon Jun 15 13:37:03 2015 -0400
Committer: Heith Seewald <hseewald@slashdotmedia.com>
Committed: Mon Jun 15 13:37:03 2015 -0400

----------------------------------------------------------------------
 Allura/allura/lib/app_globals.py | 6 +++---
 Allura/development.ini           | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/4273855b/Allura/allura/lib/app_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/app_globals.py b/Allura/allura/lib/app_globals.py
index 05fc254..7a13969 100644
--- a/Allura/allura/lib/app_globals.py
+++ b/Allura/allura/lib/app_globals.py
@@ -70,8 +70,8 @@ log = logging.getLogger(__name__)
 
 class ForgeMarkdown(markdown.Markdown):
 
-    def convert(self, source):
-        if len(source) > asint(config.get('markdown_render_max_length', 40000)):
+    def convert(self, source, render_limit=True):
+        if render_limit and len(source) > asint(config.get('markdown_render_max_length',
40000)):
             # if text is too big, markdown can take a long time to process it,
             # so we return it as a plain text
             log.info('Text is too big. Skipping markdown processing')
@@ -113,7 +113,7 @@ class ForgeMarkdown(markdown.Markdown):
 
         # Convert the markdown and time the result.
         start = time.time()
-        html = self.convert(source_text)
+        html = self.convert(source_text, render_limit=False)
         render_time = time.time() - start
 
         threshold = config.get('markdown_cache_threshold')

http://git-wip-us.apache.org/repos/asf/allura/blob/4273855b/Allura/development.ini
----------------------------------------------------------------------
diff --git a/Allura/development.ini b/Allura/development.ini
index 20ef1ca..c81ed24 100644
--- a/Allura/development.ini
+++ b/Allura/development.ini
@@ -442,7 +442,7 @@ site_notification.impressions = 0
 ; posts. Remove entirely to cache nothing.
 markdown_cache_threshold = .1
 ; markdown text longer than max length will not be converted to html
-markdown_render_max_length = 999999999
+markdown_render_max_length = 100000
 ; Don't add rel=nofollow to these domains when generating links from Markdown content
 ;nofollow_exempt_domains =
 


Mime
View raw message