From f1a83a51edd7cfbdf3f06289a3fae6292aad0433 Mon Sep 17 00:00:00 2001 From: MinchinWeb Date: Tue, 14 Apr 2015 15:13:00 -0600 Subject: [PATCH] Add testing for increasing Headings on Markdown export --- .../data/configs/markdown-headings-335.yaml | 11 ++++ .../journals/markdown-headings-335.journal | 42 +++++++++++++++ features/exporting.feature | 53 +++++++++++++++++++ 3 files changed, 106 insertions(+) create mode 100644 features/data/configs/markdown-headings-335.yaml create mode 100644 features/data/journals/markdown-headings-335.journal diff --git a/features/data/configs/markdown-headings-335.yaml b/features/data/configs/markdown-headings-335.yaml new file mode 100644 index 00000000..a32c3539 --- /dev/null +++ b/features/data/configs/markdown-headings-335.yaml @@ -0,0 +1,11 @@ +default_hour: 9 +default_minute: 0 +editor: '' +encrypt: false +highlight: true +journals: + default: features/journals/markdown-headings-335.journal +linewrap: 80 +password: '' +tagsymbols: '@' +timeformat: '%Y-%m-%d %H:%M' diff --git a/features/data/journals/markdown-headings-335.journal b/features/data/journals/markdown-headings-335.journal new file mode 100644 index 00000000..30f592ef --- /dev/null +++ b/features/data/journals/markdown-headings-335.journal @@ -0,0 +1,42 @@ +[2015-04-14 13:23] Heading Test + +H1-1 += + +H1-2 +=== + +H1-3 +============================ + +H2-1 +- + +H2-2 +--- + +H2-3 +---------------------------------- + +Horizontal Rules (ignore) + +--- + +=== + +# ATX H1 + +## ATX H2 + +### ATX H3 + +#### ATX H4 + +##### ATX H5 + +###### ATX H6 + +Stuff + +More stuff +more stuff again diff --git a/features/exporting.feature b/features/exporting.feature index 3d6c2607..85bcbea2 100644 --- a/features/exporting.feature +++ b/features/exporting.feature @@ -26,3 +26,56 @@ Feature: Exporting a Journal Then we should get no error and the output should be parsable as json and the json output should contain entries.0.uuid = "4BB1F46946AD439996C9B59DE7C4DDC1" + + Scenario: Increasing Headings on Markdown export + Given we use the config "markdown-headings-335.yaml" + When we run "jrnl --export markdown" + Then we should get error + """ + WARNING: Headings increased past H6 on export - 2015-04-14 13:23 Heading Test + """ + and the output should be + """ + 2015 + ==== + + April + ----- + + ### 2015-04-14 13:23 Heading Test + + #### H1-1 + + #### H1-2 + + #### H1-3 + + ##### H2-1 + + ##### H2-2 + + ##### H2-3 + + Horizontal Rules (ignore) + + --- + + === + + #### ATX H1 + + ##### ATX H2 + + ###### ATX H3 + + ####### ATX H4 + + ######## ATX H5 + + ######### ATX H6 + + Stuff + + More stuff + more stuff agains + """