[Pkg-cgit-commits] [pkg-cgit] 04/04: Always fall back to text lexer for syntax highlighting
Peter Colberg
peter at colberg.org
Wed Nov 23 03:55:59 UTC 2016
This is an automated email from the git hooks/post-receive script.
pc-guest pushed a commit to branch master
in repository pkg-cgit.
commit fe63c2a13021522f20021cafd4e22e269a19939a
Author: Peter Colberg <peter at colberg.org>
Date: Sat Nov 19 16:16:42 2016 -0500
Always fall back to text lexer for syntax highlighting
Thanks: Daniel Reichelt for the patch
Closes: #784621
---
debian/patches/series | 1 +
debian/patches/syntax-highlighting.patch | 21 +++++++++++++++++++++
2 files changed, 22 insertions(+)
diff --git a/debian/patches/series b/debian/patches/series
index 3cd909f..7034bd0 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -11,3 +11,4 @@ fix-spelling-in-man-page.patch
fix-spelling-of-occurred.patch
use-python3-in-md2html.patch
link-with-ldl-on-gnu-kfreebsd.patch
+syntax-highlighting.patch
diff --git a/debian/patches/syntax-highlighting.patch b/debian/patches/syntax-highlighting.patch
new file mode 100644
index 0000000..18f44cb
--- /dev/null
+++ b/debian/patches/syntax-highlighting.patch
@@ -0,0 +1,21 @@
+Description: Always fall back to text lexer for syntax highlighting
+Author: Daniel Reichelt <debian at nachtgeist.net>
+Bug-Debian: https://bugs.debian.org/784621
+Forwarded: https://lists.zx2c4.com/pipermail/cgit/2016-November/003414.html
+Last-Update: 2016-11-17
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/filters/syntax-highlighting.py
++++ b/filters/syntax-highlighting.py
+@@ -41,7 +41,10 @@
+ except ClassNotFound:
+ # check if there is any shebang
+ if data[0:2] == '#!':
+- lexer = guess_lexer(data)
++ try:
++ lexer = guess_lexer(data)
++ except ClassNotFound:
++ lexer = TextLexer()
+ else:
+ lexer = TextLexer()
+ except TypeError:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-cgit/pkg-cgit.git
More information about the Pkg-cgit-commits
mailing list