From 00a6794684f049a272fe86b8f57dade4c9d627e4 Mon Sep 17 00:00:00 2001 From: Kaushal Modi Date: Fri, 20 Jul 2018 10:01:44 -0400 Subject: [PATCH] Fix fenced code blocks in Pandoc output --- ox-hugo-pandoc-cite.el | 5 ++++- test/site/content-org/all-posts.org | 4 ++++ test/site/content/posts/citation-forms.md | 12 ++++++------ test/site/content/posts/citations-example-toml.md | 6 ++++++ 4 files changed, 20 insertions(+), 7 deletions(-) diff --git a/ox-hugo-pandoc-cite.el b/ox-hugo-pandoc-cite.el index ed2a729..f6e9c2c 100644 --- a/ox-hugo-pandoc-cite.el +++ b/ox-hugo-pandoc-cite.el @@ -14,7 +14,7 @@ ;; TODO: Change the defconst to defvar (defvar org-hugo-pandoc-cite-pandoc-args-list '("-f" "markdown" - "-t" "markdown-citations-simple_tables+pipe_tables-fenced_divs" + "-t" "markdown-citations-simple_tables+pipe_tables-fenced_divs-fenced_code_attributes" "--atx-headers" "--id-prefix=fn:") "Pandoc arguments used in `org-hugo-pandoc-cite--run-pandoc'. @@ -34,6 +34,9 @@ -fenced_divs : Do not replace HTML
tags with Pandoc fenced divs \":::\". + -fenced_code_attributes : Create fenced code blocks like + \"``` lang .. ```\" instead of \"``` {.lang} .. ```\". + --atx-headers : Use \"# foo\" style heading for output markdown. --id-prefix=fn: : Create footnote ID's like \"[^fn:1]\" instead of diff --git a/test/site/content-org/all-posts.org b/test/site/content-org/all-posts.org index 1749162..91cabcc 100644 --- a/test/site/content-org/all-posts.org +++ b/test/site/content-org/all-posts.org @@ -4635,6 +4635,10 @@ Text not containing *Markdown* | a | b | c | | d | e | f | |----------+----------+----------| +*** Testing fenced code blocks +#+begin_src emacs-lisp +(message "Hello World") +#+end_src ** Citations Example (YAML) :yaml: :PROPERTIES: :EXPORT_HUGO_FRONT_MATTER_FORMAT: yaml diff --git a/test/site/content/posts/citation-forms.md b/test/site/content/posts/citation-forms.md index 7e690ab..be13be5 100644 --- a/test/site/content/posts/citation-forms.md +++ b/test/site/content/posts/citation-forms.md @@ -10,20 +10,20 @@ draft = false The citations withing square brackets will be rendered within parentheses. -``` {.org} +``` org Blah blah [see @doe99, pp. 33-35; also @smith04, ch. 1]. ``` Blah blah (see Doe [1999](#ref-doe99), 4:33--35; also Smith [2004](#ref-smith04), ch. 1). -``` {.org} +``` org Blah blah [@doe99, pp. 33-35, 38-39]. ``` Blah blah (Doe [1999](#ref-doe99), 4:33--35, 38--39). -``` {.org} +``` org Blah blah [@smith04; @doe99]. ``` @@ -35,7 +35,7 @@ A minus sign (`-`) before the `@` will suppress mention of the author in the citation. This can be useful when the author is already mentioned in the text. -``` {.org} +``` org Smith says blah [-@smith04]. ``` @@ -43,13 +43,13 @@ Smith says blah ([2004](#ref-smith04)). ## In-text citations (no square brackets) {#in-text-citations--no-square-brackets} -``` {.org} +``` org @smith04 says blah. ``` Smith ([2004](#ref-smith04)) says blah. -``` {.org} +``` org @smith04 [p. 33] says blah. ``` diff --git a/test/site/content/posts/citations-example-toml.md b/test/site/content/posts/citations-example-toml.md index 4d35ce7..c740c04 100644 --- a/test/site/content/posts/citations-example-toml.md +++ b/test/site/content/posts/citations-example-toml.md @@ -50,6 +50,12 @@ Some text. | a | b | c | | d | e | f | +## Testing fenced code blocks + +``` emacs-lisp +(message "Hello World") +``` + ## References {#references}