diff options
-rw-r--r-- | www/py-blosxom/Makefile | 10 | ||||
-rw-r--r-- | www/py-blosxom/distinfo | 4 | ||||
-rw-r--r-- | www/py-blosxom/patches/patch-Pyblosxom_plugins_readmore.py | 30 |
3 files changed, 35 insertions, 9 deletions
diff --git a/www/py-blosxom/Makefile b/www/py-blosxom/Makefile index f865329058f..bf89f143662 100644 --- a/www/py-blosxom/Makefile +++ b/www/py-blosxom/Makefile @@ -1,9 +1,9 @@ -# $NetBSD: Makefile,v 1.24 2019/04/26 13:14:20 maya Exp $ +# $NetBSD: Makefile,v 1.25 2019/05/07 14:26:06 hauke Exp $ PYBLOXSOMVERS= 1.5.3 DISTNAME= pyblosxom-${PYBLOXSOMVERS} PKGNAME= ${PYPKGPREFIX}-blosxom-${PYBLOXSOMVERS} -PKGREVISION= 2 +PKGREVISION= 3 CATEGORIES= www MASTER_SITES= http://pyblosxom.github.com/download/ @@ -23,11 +23,11 @@ DOCFILES= AUTHORS INSTALL LICENSE README.rst UPGRADE WHATSNEW BUILD_DEPENDS+= ${PYPKGPREFIX}-docutils>=0.12:../../textproc/py-docutils -INSTALLATION_DIRS= ${DOC_SUBDIR} +INSTALLATION_DIRS= ${DOC_SUBDIR} -REPLACE_PYTHON= Pyblosxom/data/pyblosxom.cgi +REPLACE_PYTHON= Pyblosxom/data/pyblosxom.cgi -PYTHON_VERSIONS_INCOMPATIBLE= 36 37 +PYTHON_VERSIONS_ACCEPTED= 27 pre-configure: cd ${WRKSRC} && ${FIND} Pyblosxom -type f -name '*.orig' \ diff --git a/www/py-blosxom/distinfo b/www/py-blosxom/distinfo index ce272306b99..224aab6791f 100644 --- a/www/py-blosxom/distinfo +++ b/www/py-blosxom/distinfo @@ -1,7 +1,7 @@ -$NetBSD: distinfo,v 1.9 2015/11/04 02:47:24 agc Exp $ +$NetBSD: distinfo,v 1.10 2019/05/07 14:26:06 hauke Exp $ SHA1 (pyblosxom-1.5.3/pyblosxom-1.5.3.tar.gz) = 62c7b178a5aa3a9df660bf6c357e0336ff473b9d RMD160 (pyblosxom-1.5.3/pyblosxom-1.5.3.tar.gz) = fcf6be7c8d9c9fa1ec4e59d34b11afe173ced382 SHA512 (pyblosxom-1.5.3/pyblosxom-1.5.3.tar.gz) = d7829cc5fbcf7a277087bc3cd372bf7ad9f3c98429642d1304047b2b3a80473180c9a7694f9c691b57aa858a2f067a5e8fd07c2935c93861cb41ea851c107e26 Size (pyblosxom-1.5.3/pyblosxom-1.5.3.tar.gz) = 210669 bytes -SHA1 (patch-Pyblosxom_plugins_readmore.py) = e699b9b9193c540e88727cf297e6e52d59fe1fc9 +SHA1 (patch-Pyblosxom_plugins_readmore.py) = 768a7fa63e11cd971668ee4a493eb968395e7ce5 diff --git a/www/py-blosxom/patches/patch-Pyblosxom_plugins_readmore.py b/www/py-blosxom/patches/patch-Pyblosxom_plugins_readmore.py index 5633b209e6b..8e20e6e91b4 100644 --- a/www/py-blosxom/patches/patch-Pyblosxom_plugins_readmore.py +++ b/www/py-blosxom/patches/patch-Pyblosxom_plugins_readmore.py @@ -1,10 +1,30 @@ -$NetBSD: patch-Pyblosxom_plugins_readmore.py,v 1.1 2015/05/22 14:01:16 hauke Exp $ +$NetBSD: patch-Pyblosxom_plugins_readmore.py,v 1.2 2019/05/07 14:26:06 hauke Exp $ + +Try to make sure the truncated text is valid HTML Use the current flavour before the default one, if available. --- Pyblosxom/plugins/readmore.py.orig 2013-07-31 00:53:58.000000000 +0000 +++ Pyblosxom/plugins/readmore.py -@@ -209,7 +209,11 @@ def cb_story(args): +@@ -194,8 +194,15 @@ def cb_story(args): + breakpoint = config.get("readmore_breakpoint", READMORE_BREAKPOINT) + template = config.get("readmore_template", READMORE_TEMPLATE) + +- # check to see if the breakpoint is in the body. +- match = re.search(breakpoint, entry["body"]) ++ """ ++ Check to see if the breakpoint is in the body. ++ ++ Since it might have been wrapped in html tags by a markdown ++ plugin, grab everything from the end of breakpoint up to, but ++ excluding, either the first opening tag, or newline. ++ """ ++ match = re.search('(' + breakpoint + ')(.*?)(<[ ]*?[^/].+|[\n])', ++ entry["body"]) + + # if not, return because we don't have to do anything + if not match: +@@ -209,7 +216,11 @@ def cb_story(args): # otherwise we replace the breakpoint with the template base_url = config["base_url"] file_path = entry["file_path"] @@ -17,3 +37,9 @@ Use the current flavour before the default one, if available. url = '%s/%s.%s' % (base_url, file_path, flavour) link = (template % {"url": url, +@@ -218,4 +229,4 @@ def cb_story(args): + "flavour": flavour}) + + entry["just_summary"] = 1 +- entry["body"] = entry["body"][:match.start()] + link ++ entry["body"] = entry["body"][:match.start(1)] + link + str(match.group(2)) |