[debug/fix] ensure that not syntax highlighted code is a string
authorLaurent Peuch <cortex@worlddomination.be>
Fri, 27 Sep 2019 06:20:39 +0200
changeset 12769 a61e0fe17a69
parent 12768 7d2c61d40fe9
child 12770 be0864a2eec8
[debug/fix] ensure that not syntax highlighted code is a string Otherwise it could be in another unrendered form that makes marko complains. Closes #17256791
cubicweb/misc/source_highlight.py
--- a/cubicweb/misc/source_highlight.py	Thu Sep 12 05:59:10 2019 +0200
+++ b/cubicweb/misc/source_highlight.py	Fri Sep 27 06:20:39 2019 +0200
@@ -24,7 +24,7 @@
 
 def highlight_html(code, language, linenos=False):
     if not has_pygments:
-        return code
+        return str(code)
 
     return pygments_highlight(str(code), get_lexer_by_name(language), HtmlFormatter(wrapcode=True, linenos=linenos))