Skip to content

Commit

Permalink
use {% codeblock %} style blocks if there is no language specified
Browse files Browse the repository at this point in the history
I was running into this problem
imathis/octopress#1342 an awful lot, and it
was happening in really wonky scenarios that seemed to be dependent on
the number of code blocks in a file (?!!)

Using these other code block delimeters for blocks without a language
specified seems to skip the syntax highlighting code path
  • Loading branch information
michiakig committed Sep 2, 2013
1 parent 09485f4 commit b734ddf
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions octorgopress.el
Expand Up @@ -59,18 +59,18 @@ categories:
(let* ((lang (get-lang (org-element-property :language src-block)))
(value (org-element-property :value src-block))
(name (org-element-property :name src-block))
(lang-and-name
(header
;; backtick code blocks support lang or lang and name, but not name alone
(cond ((and lang name)
(concat " " lang " " name "\n"))
(concat "``` " lang " " name "\n"))
(lang
(concat " " lang "\n"))
(t "\n"))))
(concat "``` " lang "\n"))
(t "{% codeblock %}\n")))
(footer (if lang "```\n" "{% endcodeblock %}\n")))
(concat
"```"
lang-and-name
header
value
"```\n"
footer
contents)))

(defun repeat (x n)
Expand Down

0 comments on commit b734ddf

Please sign in to comment.