[Python-modules-commits] r29093 - in packages/python-markdown/trunk/debian (4 files)

mitya57-guest at users.alioth.debian.org mitya57-guest at users.alioth.debian.org
Tue May 27 08:55:32 UTC 2014


    Date: Tuesday, May 27, 2014 @ 08:55:31
  Author: mitya57-guest
Revision: 29093

* New upstream bugfix release.
* Backport upstream commits to make smarty extension work together
  with attr_list.

Added:
  packages/python-markdown/trunk/debian/patches/
  packages/python-markdown/trunk/debian/patches/series
  packages/python-markdown/trunk/debian/patches/smarty_fixes.patch
Modified:
  packages/python-markdown/trunk/debian/changelog

Modified: packages/python-markdown/trunk/debian/changelog
===================================================================
--- packages/python-markdown/trunk/debian/changelog	2014-05-26 20:59:54 UTC (rev 29092)
+++ packages/python-markdown/trunk/debian/changelog	2014-05-27 08:55:31 UTC (rev 29093)
@@ -1,3 +1,11 @@
+python-markdown (2.4.1-1) UNRELEASED; urgency=medium
+
+  * New upstream bugfix release.
+  * Backport upstream commits to make smarty extension work together
+    with attr_list.
+
+ -- Dmitry Shachnev <mitya57 at gmail.com>  Tue, 27 May 2014 12:51:34 +0400
+
 python-markdown (2.4-1) unstable; urgency=low
 
   [ Dmitry Shachnev ]

Added: packages/python-markdown/trunk/debian/patches/series
===================================================================
--- packages/python-markdown/trunk/debian/patches/series	                        (rev 0)
+++ packages/python-markdown/trunk/debian/patches/series	2014-05-27 08:55:31 UTC (rev 29093)
@@ -0,0 +1 @@
+smarty_fixes.patch

Added: packages/python-markdown/trunk/debian/patches/smarty_fixes.patch
===================================================================
--- packages/python-markdown/trunk/debian/patches/smarty_fixes.patch	                        (rev 0)
+++ packages/python-markdown/trunk/debian/patches/smarty_fixes.patch	2014-05-27 08:55:31 UTC (rev 29093)
@@ -0,0 +1,80 @@
+Description: Make smarty extension use its own InlineProcessor
+Origin: upstream, https://github.com/waylan/Python-Markdown/pull/311
+Last-Update: 2014-05-27
+
+--- a/markdown/extensions/smarty.py
++++ b/markdown/extensions/smarty.py
+@@ -68,6 +68,8 @@
+ from __future__ import unicode_literals
+ from . import Extension
+ from ..inlinepatterns import HtmlPattern
++from ..odict import OrderedDict
++from ..treeprocessors import InlineProcessor
+ from ..util import parseBoolValue
+ 
+ # Constants for quote education.
+@@ -145,20 +147,20 @@
+         for ind, pattern in enumerate(patterns):
+             pattern += (md,)
+             pattern = SubstituteTextPattern(*pattern)
+-            after = ('>smarty-%s-%d' % (serie, ind - 1) if ind else '>entity')
++            after = ('>smarty-%s-%d' % (serie, ind - 1) if ind else '_begin')
+             name = 'smarty-%s-%d' % (serie, ind)
+-            md.inlinePatterns.add(name, pattern, after)
++            self.inlinePatterns.add(name, pattern, after)
+ 
+     def educateDashes(self, md):
+         emDashesPattern = SubstituteTextPattern(r'(?<!-)---(?!-)', ('—',), md)
+         enDashesPattern = SubstituteTextPattern(r'(?<!-)--(?!-)', ('–',), md)
+-        md.inlinePatterns.add('smarty-em-dashes', emDashesPattern, '>entity')
+-        md.inlinePatterns.add('smarty-en-dashes', enDashesPattern,
++        self.inlinePatterns.add('smarty-em-dashes', emDashesPattern, '_begin')
++        self.inlinePatterns.add('smarty-en-dashes', enDashesPattern,
+             '>smarty-em-dashes')
+ 
+     def educateEllipses(self, md):
+         ellipsesPattern = SubstituteTextPattern(r'(?<!\.)\.{3}(?!\.)', ('…',), md)
+-        md.inlinePatterns.add('smarty-ellipses', ellipsesPattern, '>entity')
++        self.inlinePatterns.add('smarty-ellipses', ellipsesPattern, '_begin')
+ 
+     def educateQuotes(self, md):
+         patterns = (
+@@ -179,12 +181,16 @@
+ 
+     def extendMarkdown(self, md, md_globals):
+         configs = self.getConfigs()
++        self.inlinePatterns = OrderedDict()
+         if configs['smart_quotes']:
+             self.educateQuotes(md)
+         if configs['smart_dashes']:
+             self.educateDashes(md)
+         if configs['smart_ellipses']:
+             self.educateEllipses(md)
++        inlineProcessor = InlineProcessor(md)
++        inlineProcessor.inlinePatterns = self.inlinePatterns
++        md.treeprocessors.add('smarty', inlineProcessor, '_end')
+         md.ESCAPED_CHARS.extend(['"', "'"])
+ 
+ def makeExtension(configs=None):
+--- a/markdown/treeprocessors.py
++++ b/markdown/treeprocessors.py
+@@ -53,6 +53,7 @@
+                                       + len(self.__placeholder_suffix)
+         self.__placeholder_re = util.INLINE_PLACEHOLDER_RE
+         self.markdown = md
++        self.inlinePatterns = md.inlinePatterns
+ 
+     def __makePlaceholder(self, type):
+         """ Generate a placeholder """
+@@ -99,9 +100,9 @@
+         """
+         if not isinstance(data, util.AtomicString):
+             startIndex = 0
+-            while patternIndex < len(self.markdown.inlinePatterns):
++            while patternIndex < len(self.inlinePatterns):
+                 data, matched, startIndex = self.__applyPattern(
+-                    self.markdown.inlinePatterns.value_for_index(patternIndex),
++                    self.inlinePatterns.value_for_index(patternIndex),
+                     data, patternIndex, startIndex)
+                 if not matched:
+                     patternIndex += 1




More information about the Python-modules-commits mailing list