From 44cd8902be700c43d6e4254e5d3c55d0acfb7cfb Mon Sep 17 00:00:00 2001 From: Kaushal Modi Date: Wed, 2 Aug 2017 15:16:39 -0400 Subject: [PATCH] Add tests for lists in code blocks and code blocks in lists https://github.com/kaushalmodi/ox-hugo/issues/57 --- example-site/content-org/all-posts.org | 40 +++++++++++++++++++ .../list-has-src-block-but-no-list-syntax.md | 18 +++++++++ .../list-has-src-block-with-list-syntax.md | 22 ++++++++++ ...src-block-outside-list-with-list-syntax.md | 10 +++++ 4 files changed, 90 insertions(+) create mode 100644 example-site/content/posts/list-has-src-block-but-no-list-syntax.md create mode 100644 example-site/content/posts/list-has-src-block-with-list-syntax.md create mode 100644 example-site/content/posts/src-block-outside-list-with-list-syntax.md diff --git a/example-site/content-org/all-posts.org b/example-site/content-org/all-posts.org index 889fff4..93187ff 100644 --- a/example-site/content-org/all-posts.org +++ b/example-site/content-org/all-posts.org @@ -352,6 +352,46 @@ property needs to be left *empty* instead of setting to =nil=! #+BEGIN_SRC makefile prefix = /dir/where/you/want/to/install/org # Default: /usr/share #+END_SRC +** Source block with list syntax in a list :@fixme:upstream: +:PROPERTIES: +:EXPORT_DATE: 2017-08-01 +:EXPORT_FILE_NAME: list-has-src-block-with-list-syntax +:END: +As of today (<2017-08-02 Wed>), an upstream bug in /Blackfriday/ +([[https://github.com/russross/blackfriday/issues/239][Issue #239]]) causes fenced code blocks in lists to not render +correctly if they contain Markdown syntax lists. + +Below is an example of such a case: + +- List item 1 + #+BEGIN_SRC md +- List item 1 in code block +- List item 2 in code block + #+END_SRC +- List item 2 +- List item 3 +** Source block without list syntax in a list +:PROPERTIES: +:EXPORT_DATE: 2017-08-01 +:EXPORT_FILE_NAME: list-has-src-block-but-no-list-syntax +:END: +This case is not affected by /Blackfriday/ [[https://github.com/russross/blackfriday/issues/239][Issue #239]] as the fenced +code block does not have Markdown syntax lists. +- List item 1 + #+BEGIN_SRC md +,*abc* +/def/ +=def= + #+END_SRC +- List item 2 +** Source block with list syntax but not in a list +:PROPERTIES: +:EXPORT_DATE: 2017-08-01 +:EXPORT_FILE_NAME: src-block-outside-list-with-list-syntax +:END: +#+BEGIN_SRC md +- list 1 +#+END_SRC * Formatting :formatting: ** General :PROPERTIES: diff --git a/example-site/content/posts/list-has-src-block-but-no-list-syntax.md b/example-site/content/posts/list-has-src-block-but-no-list-syntax.md new file mode 100644 index 0000000..eccad86 --- /dev/null +++ b/example-site/content/posts/list-has-src-block-but-no-list-syntax.md @@ -0,0 +1,18 @@ ++++ +title = "Source block without list syntax in a list" +date = 2017-08-01 +tags = [] +draft = false ++++ + +This case is not affected by _Blackfriday_ [Issue #239](https://github.com/russross/blackfriday/issues/239) as the fenced +code block does not have Markdown syntax lists. + +- List item 1 + + ```md + *abc* + /def/ + =def= + ``` +- List item 2 diff --git a/example-site/content/posts/list-has-src-block-with-list-syntax.md b/example-site/content/posts/list-has-src-block-with-list-syntax.md new file mode 100644 index 0000000..17872be --- /dev/null +++ b/example-site/content/posts/list-has-src-block-with-list-syntax.md @@ -0,0 +1,22 @@ ++++ +title = "Source block with list syntax in a list" +date = 2017-08-01 +tags = ["upstream"] +categories = ["fixme"] +draft = false ++++ + +As of today (<2017-08-02 Wed>), an upstream bug in _Blackfriday_ +([Issue #239](https://github.com/russross/blackfriday/issues/239)) causes fenced code blocks in lists to not render +correctly if they contain Markdown syntax lists. + +Below is an example of such a case: + +- List item 1 + + ```md + - List item 1 in code block + - List item 2 in code block + ``` +- List item 2 +- List item 3 diff --git a/example-site/content/posts/src-block-outside-list-with-list-syntax.md b/example-site/content/posts/src-block-outside-list-with-list-syntax.md new file mode 100644 index 0000000..b4e30bd --- /dev/null +++ b/example-site/content/posts/src-block-outside-list-with-list-syntax.md @@ -0,0 +1,10 @@ ++++ +title = "Source block with list syntax but not in a list" +date = 2017-08-01 +tags = [] +draft = false ++++ + +```md +- list 1 +```