ajwillia-ms pushed a commit to branch master. http://git.enlightenment.org/website/www.git/commit/?id=8265721765383a04ad9266a4545e84dcfe30f708
commit 8265721765383a04ad9266a4545e84dcfe30f708 Author: Andy Williams <[email protected]> Date: Tue Oct 10 21:44:22 2017 +0100 apply syntax highlighting to markdown formatted docs --- public_html/lib/plugins/markdownextra/markdown.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/public_html/lib/plugins/markdownextra/markdown.php b/public_html/lib/plugins/markdownextra/markdown.php index 0edba0f3..cb1ed3aa 100755 --- a/public_html/lib/plugins/markdownextra/markdown.php +++ b/public_html/lib/plugins/markdownextra/markdown.php @@ -2968,14 +2968,17 @@ class MarkdownExtra_Parser extends Markdown_Parser { if ($classname != "") { if ($classname{0} == '.') $classname = substr($classname, 1); - $attr_str = ' class="'.$this->code_class_prefix.$classname.'"'; + $attr_str = ' class="code '.$this->code_class_prefix.$classname.'"'; } else { $attr_str = $this->doExtraAttributes($this->code_attr_on_pre ? "pre" : "code", $attrs); } $pre_attr_str = $this->code_attr_on_pre ? $attr_str : ''; $code_attr_str = $this->code_attr_on_pre ? '' : $attr_str; - $codeblock = "<pre$pre_attr_str><code$code_attr_str>$codeblock</code></pre>"; - + + // apply syntax metadata to the code block + $syntaxcode = p_xhtml_cached_geshi($codeblock, $classname, null); + $codeblock = "<pre$pre_attr_str><code$code_attr_str>$syntaxcode</code></pre>"; + return "\n\n".$this->hashBlock($codeblock)."\n\n"; } function _doFencedCodeBlocks_newlines($matches) { --
