allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [1/4] allura git commit: [#7987] ticket:882 Remove deprecated FencedCodeProcessor, change user docs
Date Wed, 06 Jan 2016 17:06:25 GMT
Repository: allura
Updated Branches:
  refs/heads/master 19c532faa -> dfa249a65


[#7987] ticket:882 Remove deprecated FencedCodeProcessor, change user docs


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

Branch: refs/heads/master
Commit: 307f45b47a57a5e4ebcf31b43e414c1183594354
Parents: b8712c0
Author: Denis Kotov <deniskkotov@gmail.com>
Authored: Mon Dec 28 12:13:34 2015 +0200
Committer: Dave Brondsema <dave@brondsema.net>
Committed: Wed Jan 6 12:06:03 2016 -0500

----------------------------------------------------------------------
 Allura/allura/lib/app_globals.py              |  2 +-
 Allura/allura/lib/markdown_extensions.py      | 19 -------------------
 Allura/allura/templates/jinja_master/lib.html |  2 ++
 3 files changed, 3 insertions(+), 20 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/307f45b4/Allura/allura/lib/app_globals.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/app_globals.py b/Allura/allura/lib/app_globals.py
index f7392cd..7e8e5db 100644
--- a/Allura/allura/lib/app_globals.py
+++ b/Allura/allura/lib/app_globals.py
@@ -439,7 +439,7 @@ class Globals(object):
         '''return a markdown.Markdown object on which you can call convert'''
         return ForgeMarkdown(
             # 'fenced_code'
-            extensions=['codehilite',
+            extensions=['fenced_code', 'codehilite',
                         ForgeExtension(
                             **kwargs), 'tables', 'toc', 'nl2br'],
             output_format='html4')

http://git-wip-us.apache.org/repos/asf/allura/blob/307f45b4/Allura/allura/lib/markdown_extensions.py
----------------------------------------------------------------------
diff --git a/Allura/allura/lib/markdown_extensions.py b/Allura/allura/lib/markdown_extensions.py
index 016c5e4..c292d66 100644
--- a/Allura/allura/lib/markdown_extensions.py
+++ b/Allura/allura/lib/markdown_extensions.py
@@ -21,7 +21,6 @@ from urlparse import urljoin
 
 from tg import config
 from bs4 import BeautifulSoup
-from markdown.extensions.fenced_code import FencedBlockPreprocessor
 import html5lib
 import html5lib.serializer
 import html5lib.filters.alphabeticalattributes
@@ -249,7 +248,6 @@ class ForgeExtension(markdown.Extension):
         # allow markdown within e.g. <div markdown>...</div>  More info at:
         # https://github.com/waylan/Python-Markdown/issues/52
         md.preprocessors['html_block'].markdown_in_raw = True
-        md.preprocessors['fenced-code'] = FencedBlockPreprocessor(md)
         md.preprocessors.add('plain_text_block', PlainTextPreprocessor(md), "_begin")
         md.preprocessors.add('macro_include', ForgeMacroIncludePreprocessor(md), '_end')
         # this has to be before the 'escape' processor, otherwise weird
@@ -376,23 +374,6 @@ class PlainTextPreprocessor(markdown.preprocessors.Preprocessor):
         return txt
 
 
-class FencedCodeProcessor(markdown.preprocessors.Preprocessor):
-    pattern = '~~~~'
-
-    def run(self, lines):
-        in_block = False
-        new_lines = []
-        for line in lines:
-            if line.lstrip().startswith(self.pattern):
-                in_block = not in_block
-                continue
-            if in_block:
-                new_lines.append('    ' + line)
-            else:
-                new_lines.append(line)
-        return new_lines
-
-
 class ForgeMacroPattern(markdown.inlinepatterns.Pattern):
 
     def __init__(self, *args, **kwargs):

http://git-wip-us.apache.org/repos/asf/allura/blob/307f45b4/Allura/allura/templates/jinja_master/lib.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/jinja_master/lib.html b/Allura/allura/templates/jinja_master/lib.html
index b3626e9..b913f41 100644
--- a/Allura/allura/templates/jinja_master/lib.html
+++ b/Allura/allura/templates/jinja_master/lib.html
@@ -731,6 +731,8 @@ allowed, permitting basic styling and layout: &lt;div markdown style="float:left
 ~~~~~~''')}}
 </div>
 
+<p><a href="https://pythonhosted.org/Markdown/extensions/fenced_code_blocks.html">Fenced
Code Blocks syntax is also supported</a> </p>
+
 
 <div class="markdown_syntax_section hidden_in_modal md_ex_includes{{id}}">
 <h2 id="md_ex_includes{{id}}">Includes</h2>


Mime
View raw message