[arch-commits] Commit in python-markdown/repos/community-any (3 files)
Christian Hesse
eworm at archlinux.org
Tue Mar 5 08:12:41 UTC 2019
Date: Tuesday, March 5, 2019 @ 08:12:41
Author: eworm
Revision: 437712
archrelease: copy trunk to community-any
Added:
python-markdown/repos/community-any/0001-fix-double-escaping.patch
(from rev 437711, python-markdown/trunk/0001-fix-double-escaping.patch)
python-markdown/repos/community-any/PKGBUILD
(from rev 437711, python-markdown/trunk/PKGBUILD)
Deleted:
python-markdown/repos/community-any/PKGBUILD
--------------------------------+
0001-fix-double-escaping.patch | 32 ++++++++
PKGBUILD | 140 ++++++++++++++++++++-------------------
2 files changed, 104 insertions(+), 68 deletions(-)
Copied: python-markdown/repos/community-any/0001-fix-double-escaping.patch (from rev 437711, python-markdown/trunk/0001-fix-double-escaping.patch)
===================================================================
--- 0001-fix-double-escaping.patch (rev 0)
+++ 0001-fix-double-escaping.patch 2019-03-05 08:12:41 UTC (rev 437712)
@@ -0,0 +1,32 @@
+From f43f515333519b44f76746d80e0e77876bf76804 Mon Sep 17 00:00:00 2001
+From: facelessuser <faceless.shop at gmail.com>
+Date: Sun, 7 Oct 2018 12:29:05 -0600
+Subject: Fix double escaping of block code
+
+Ref #725
+diff --git a/markdown/extensions/codehilite.py b/markdown/extensions/codehilite.py
+index d204ebf7..712618f6 100644
+--- a/markdown/extensions/codehilite.py
++++ b/markdown/extensions/codehilite.py
+@@ -200,13 +200,20 @@ def _parseHeader(self):
+ class HiliteTreeprocessor(Treeprocessor):
+ """ Hilight source code in code blocks. """
+
++ def code_unescape(self, text):
++ """Unescape code."""
++ text = text.replace("&", "&")
++ text = text.replace("<", "<")
++ text = text.replace(">", ">")
++ return text
++
+ def run(self, root):
+ """ Find code blocks and store in htmlStash. """
+ blocks = root.iter('pre')
+ for block in blocks:
+ if len(block) == 1 and block[0].tag == 'code':
+ code = CodeHilite(
+- block[0].text,
++ self.code_unescape(block[0].text),
+ linenums=self.config['linenums'],
+ guess_lang=self.config['guess_lang'],
+ css_class=self.config['css_class'],
Deleted: PKGBUILD
===================================================================
--- PKGBUILD 2019-03-05 08:12:38 UTC (rev 437711)
+++ PKGBUILD 2019-03-05 08:12:41 UTC (rev 437712)
@@ -1,68 +0,0 @@
-# Maintainer: Kyle Keen <keenerd at gmail.com>
-# Contributor: Angel Velasquez <angvp at archlinux.org>
-# Contributor: Andrew Antle <andrew dot antle at gmail dot com>
-# Contributor: Thomas Dziedzic < gostrc at gmail >
-# Contributor: Chaiwat Suttipongsakul <cwt at bashell dot com>
-
-pkgbase=python-markdown
-pkgname=('python-markdown' 'python2-markdown')
-_pkgbasename=Markdown
-pkgver=3.0.1
-pkgrel=1
-pkgdesc="Python implementation of John Gruber's Markdown."
-arch=('any')
-url='https://python-markdown.github.io/'
-license=('BSD')
-depends=('python')
-makedepends=('python' 'python2' 'python-setuptools' 'python2-setuptools')
-checkdepends=('python-yaml' 'python2-yaml')
-source=("https://files.pythonhosted.org/packages/source/M/$_pkgbasename/$_pkgbasename-$pkgver.tar.gz")
-md5sums=('72219f46ca440b657bf227500731bdf1')
-
-prepare() {
- # bug in 2.4, some DOS line endings slipped in
- find "$_pkgbasename-$pkgver/" -name '*py' -exec sed -i 's|\r||g' {} +
-
- cp -r $_pkgbasename-$pkgver "$srcdir/python2-markdown"
- cd "$srcdir/python2-markdown"
- find "$srcdir/python2-markdown" -name '*py' -exec sed -i 's|#!/usr/bin/env python$|&2|' {} +
-}
-
-build() {
- cd "$srcdir/$_pkgbasename-$pkgver"
- python setup.py build
- cd "$srcdir/python2-markdown"
- python2 setup.py build
-}
-
-check() {
- cd "$srcdir/$_pkgbasename-$pkgver"
- python -m unittest discover tests
- cd "$srcdir/python2-markdown"
- python2 -m unittest discover tests
-}
-
-package_python-markdown() {
- depends=('python')
- cd "$srcdir/$_pkgbasename-$pkgver"
- python3 setup.py install --root="$pkgdir" --optimize=0
- install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/python-markdown/LICENSE"
-}
-
-package_python2-markdown() {
- depends=('python2')
- cd "$srcdir/python2-markdown"
- python2 setup.py install --root="$pkgdir" --optimize=0
- mv "$pkgdir/usr/bin/markdown_py" "$pkgdir/usr/bin/markdown_py2"
- install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/python2-markdown/LICENSE"
-}
-
-check_python-markdown() {
- [[ $(python -c "import markdown; print(markdown._get_version())") == "$pkgver" ]]
- [[ $(python -c "import markdown; print(markdown.markdown('*test*'))") == "<p><em>test</em></p>" ]]
-}
-
-check_python2-markdown() {
- [[ $(python2 -c "import markdown; print(markdown._get_version())") == "$pkgver" ]]
- [[ $(python2 -c "import markdown; print(markdown.markdown('*test*'))") == "<p><em>test</em></p>" ]]
-}
Copied: python-markdown/repos/community-any/PKGBUILD (from rev 437711, python-markdown/trunk/PKGBUILD)
===================================================================
--- PKGBUILD (rev 0)
+++ PKGBUILD 2019-03-05 08:12:41 UTC (rev 437712)
@@ -0,0 +1,72 @@
+# Maintainer: Kyle Keen <keenerd at gmail.com>
+# Contributor: Angel Velasquez <angvp at archlinux.org>
+# Contributor: Andrew Antle <andrew dot antle at gmail dot com>
+# Contributor: Thomas Dziedzic < gostrc at gmail >
+# Contributor: Chaiwat Suttipongsakul <cwt at bashell dot com>
+
+pkgbase=python-markdown
+pkgname=('python-markdown' 'python2-markdown')
+_pkgbasename=Markdown
+pkgver=3.0.1
+pkgrel=2
+pkgdesc="Python implementation of John Gruber's Markdown."
+arch=('any')
+url='https://python-markdown.github.io/'
+license=('BSD')
+depends=('python')
+makedepends=('python' 'python2' 'python-setuptools' 'python2-setuptools')
+checkdepends=('python-yaml' 'python2-yaml')
+source=("https://files.pythonhosted.org/packages/source/M/$_pkgbasename/$_pkgbasename-$pkgver.tar.gz"
+ '0001-fix-double-escaping.patch')
+md5sums=('72219f46ca440b657bf227500731bdf1'
+ '8ecbe4dc23be24a49bff904126535857')
+
+prepare() {
+ # bug in 2.4, some DOS line endings slipped in
+ find "$_pkgbasename-$pkgver/" -name '*py' -exec sed -i 's|\r||g' {} +
+
+ patch -d "$_pkgbasename-$pkgver/" -Np1 < "${srcdir}"/0001-fix-double-escaping.patch
+
+ cp -r $_pkgbasename-$pkgver "$srcdir/python2-markdown"
+ cd "$srcdir/python2-markdown"
+ find "$srcdir/python2-markdown" -name '*py' -exec sed -i 's|#!/usr/bin/env python$|&2|' {} +
+}
+
+build() {
+ cd "$srcdir/$_pkgbasename-$pkgver"
+ python setup.py build
+ cd "$srcdir/python2-markdown"
+ python2 setup.py build
+}
+
+check() {
+ cd "$srcdir/$_pkgbasename-$pkgver"
+ python -m unittest discover tests
+ cd "$srcdir/python2-markdown"
+ python2 -m unittest discover tests
+}
+
+package_python-markdown() {
+ depends=('python')
+ cd "$srcdir/$_pkgbasename-$pkgver"
+ python3 setup.py install --root="$pkgdir" --optimize=0
+ install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/python-markdown/LICENSE"
+}
+
+package_python2-markdown() {
+ depends=('python2')
+ cd "$srcdir/python2-markdown"
+ python2 setup.py install --root="$pkgdir" --optimize=0
+ mv "$pkgdir/usr/bin/markdown_py" "$pkgdir/usr/bin/markdown_py2"
+ install -Dm644 LICENSE.md "$pkgdir/usr/share/licenses/python2-markdown/LICENSE"
+}
+
+check_python-markdown() {
+ [[ $(python -c "import markdown; print(markdown._get_version())") == "$pkgver" ]]
+ [[ $(python -c "import markdown; print(markdown.markdown('*test*'))") == "<p><em>test</em></p>" ]]
+}
+
+check_python2-markdown() {
+ [[ $(python2 -c "import markdown; print(markdown._get_version())") == "$pkgver" ]]
+ [[ $(python2 -c "import markdown; print(markdown.markdown('*test*'))") == "<p><em>test</em></p>" ]]
+}
More information about the arch-commits
mailing list