From bd85f6a56f248780ba6eac87d30d7939e4ac40e3 Mon Sep 17 00:00:00 2001 From: Benjamin Staffin Date: Thu, 2 May 2019 15:38:12 -0400 Subject: [PATCH] Use triple-backtick block syntax for example blocks too org-mode `#+BEGIN_EXAMPLE` blocks can (optionally) be tagged with a language, so this will give them proper syntax highlighting on GitHub. It still works when the language is unset, of course. --- ox-gfm.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ox-gfm.el b/ox-gfm.el index d79a85f..9939c95 100644 --- a/ox-gfm.el +++ b/ox-gfm.el @@ -56,6 +56,7 @@ :translate-alist '((inner-template . org-gfm-inner-template) (paragraph . org-gfm-paragraph) (strike-through . org-gfm-strike-through) + (example-block . org-gfm-example-block) (src-block . org-gfm-src-block) (table-cell . org-gfm-table-cell) (table-row . org-gfm-table-row) @@ -92,6 +93,10 @@ channel." (suffix "```")) (concat prefix code suffix))) +;;;; Example Block + +(defalias 'org-gfm-example-block #'org-gfm-src-block) + ;;;; Strike-Through @@ -284,7 +289,7 @@ holding export options." (toc-string (or (mapconcat 'org-gfm-format-toc headlines "\n") "")) (toc-tail (if headlines "\n\n" ""))) (org-trim (concat toc-string toc-tail contents "\n" (org-gfm-footnote-section info))))) - +