Closed yuezhu closed 6 years ago
When exporting an Org file with #+OPTIONS: toc:t in the beginning, an error would occur and no markdown would be exported.
#+OPTIONS: toc:t
Using this simple Org file can reproduce this problem
#+TITLE: TEST #+OPTIONS: toc:t
Headline 1
Debug trace
Debugger entered--Lisp error: (error "Format specifier doesn’t match argument type") format("%d." "nil") #[257 "\301\302\300\"S\303_\304\"\305\306\307\300\"\310!@\262\"\211\301\303GZ\304\"P\305\311\312\313\300\"\314\315!\300#\316\211;\203= \317\320#\202C \321A@\"\266\202\206M \322\300\"#\321\300\323\"\205q \321\300\323\"\324=?\205q \325\300\"\211\205o \305\326\327\330\331#\"\262R\207" [(:export-options nil :back-end [cl-struct-org-export-backend md html ((bold . org-md-bold) (code . org-md-verbatim) (example-block . org-md-example-block) (export-block . org-md-export-block) (fixed-width . org-md-example-block) (headline . org-md-headline) (horizontal-rule . org-md-horizontal-rule) (inline-src-block . org-md-verbatim) (inner-template . org-md-inner-template) (italic . org-md-italic) (item . org-md-item) (keyword . org-md-keyword) (line-break . org-md-line-break) (link . org-md-link) (node-property . org-md-node-property) (paragraph . org-md-paragraph) (plain-list . org-md-plain-list) (plain-text . org-md-plain-text) (property-drawer . org-md-property-drawer) (quote-block . org-md-quote-block) (section . org-md-section) (src-block . org-md-example-block) (template . org-md-template) (verbatim . org-md-verbatim)) ((:md-footnote-format nil nil org-md-footnote-format) (:md-footnotes-section nil nil org-md-footnotes-section) (:md-headline-style nil nil org-md-headline-style)) ((:filter-parse-tree . org-md-separate-elements)) nil (109 "Export to Markdown" ((77 "To temporary buffer" (lambda ... ...)) (109 "To file" (lambda ... ...)) (111 "To file and open" (lambda ... ...))))] :translate-alist ((bold . org-md-bold) (code . org-md-verbatim) (example-block . org-md-example-block) (export-block . org-md-export-block) (fixed-width . org-md-example-block) (headline . org-md-headline) (horizontal-rule . org-md-horizontal-rule) (inline-src-block . org-md-verbatim) (inner-template . org-md-inner-template) (italic . org-md-italic) (item . org-md-item) (keyword . org-md-keyword) (line-break . org-md-line-break) (link . org-md-link) (node-property . org-md-node-property) (paragraph . org-md-paragraph) (plain-list . org-md-plain-list) (plain-text . org-md-plain-text) (property-drawer . org-md-property-drawer) (quote-block . org-md-quote-block) (section . org-md-section) (src-block . org-md-example-block) (template . org-md-template) (verbatim . org-md-verbatim) (bold . org-html-bold) (center-block . org-html-center-block) (clock . org-html-clock) (code . org-html-code) (drawer . org-html-drawer) (dynamic-block . org-html-dynamic-block) (entity . org-html-entity) (example-block . org-html-example-block) (export-block . org-html-export-block) (export-snippet . org-html-export-snippet) (fixed-width . org-html-fixed-width) (footnote-definition . org-html-footnote-definition) (footnote-reference . org-html-footnote-reference) (headline . org-html-headline) (horizontal-rule . org-html-horizontal-rule) (inline-src-block . org-html-inline-src-block) (inlinetask . org-html-inlinetask) (inner-template . org-html-inner-template) (italic . org-html-italic) (item . org-html-item) (keyword . org-html-keyword) (latex-environment . org-html-latex-environment) (latex-fragment . org-html-latex-fragment) (line-break . org-html-line-break) (link . org-html-link) (node-property . org-html-node-property) ...) :exported-data #s(hash-table size 4001 test eq rehash-size 1.5 rehash-threshold 0.8 data ((keyword (:key "TITLE" :value "TEST" :begin 1 :end 15 :post-blank 1 :post-affiliated 1 :parent (section (:begin 1 :end 32 :contents-begin 1 :contents-end 32 :post-blank 1 :post-affiliated 1 :parent ...) #4 (keyword ...)))) "" (keyword (:key "OPTIONS" :value "toc:t" :begin 15 :end 32 :post-blank 1 :post-affiliated 15 :parent (section (:begin 1 :end 32 :contents-begin 1 :contents-end 32 :post-blank 1 :post-affiliated 1 :parent ...) (keyword ...) #4))) "" (section (:begin 1 :end 32 :contents-begin 1 :contents-end 32 :post-blank 1 :post-affiliated 1 :parent (org-data nil #4 (headline ...))) (keyword (:key "TITLE" :value "TEST" :begin 1 :end 15 :post-blank 1 :post-affiliated 1 :parent #4)) (keyword (:key "OPTIONS" :value "toc:t" :begin 15 :end 32 :post-blank 1 :post-affiliated 15 :parent #4))) "\n" #("Headline 1" 0 10 (:parent (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title ... :parent ...)))) #("Headline 1" 0 10 (:parent (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title ... :parent ...)))) (#("Headline 1" 0 10 (:parent (headline ...)))) #("Headline 1" 0 10 (:parent (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title ... :parent ...)))) (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#("Headline 1" 0 10 ...)) :parent (org-data nil (section ... ... ...) #4))) #("\n<a id=\"org30c3ef9\"></a>\n\n# Headline 1\n\n" 28 38 (:parent (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title ... :parent ...)))) (org-data nil (section (:begin 1 :end 32 :contents-begin 1 :contents-end 32 :post-blank 1 :post-affiliated 1 :parent #4) (keyword (:key "TITLE" :value "TEST" :begin 1 :end 15 :post-blank 1 :post-affiliated 1 :parent #5)) (keyword (:key "OPTIONS" :value "toc:t" :begin 15 :end 32 :post-blank 1 :post-affiliated 15 :parent #5))) (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#("Headline 1" 0 10 ...)) :parent #4))) #("\n\n<a id=\"org30c3ef9\"></a>\n\n# Headline 1\n\n" 29 39 (:parent (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title ... :parent ...)))) ...)) :input-buffer "test.org" :input-file "/Users/yuezhu/test.org" :md-footnote-format "<sup>%s</sup>" :md-footnotes-section "%s%s" :md-headline-style atx :html-doctype "xhtml-strict" :html-container "div" :description nil :keywords nil :html-html5-fancy nil :html-link-use-abs-url nil :html-link-home "" :html-link-up "" :html-mathjax "" :html-postamble auto :html-preamble t :html-head "" :html-head-extra "" :subtitle nil :html-head-include-default-style t :html-head-include-scripts t ...) make-string org-export-get-relative-level 4 32 format "%d." org-export-get-headline-number last "[%s](#%s)" org-export-data-with-backend org-export-get-alt-title org-export-toc-entry-backend md :CUSTOM_ID get-text-property 0 plist-get org-export-get-reference :with-tags not-in-toc org-export-get-tags ":%s:" mapconcat identity ":"] 13 "\n\n(fn HEADLINE)"]((headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#("Headline 1" 0 10 (:parent #0))) :parent (org-data nil (section (:begin 1 :end 32 :contents-begin 1 :contents-end 32 :post-blank 1 :post-affiliated 1 :parent #2) (keyword (:key "TITLE" :value "TEST" :begin 1 :end 15 :post-blank 1 :post-affiliated 1 :parent #3)) (keyword (:key "OPTIONS" :value "toc:t" :begin 15 :end 32 :post-blank 1 :post-affiliated 15 :parent #3))) #0)))) mapconcat(#[257 "\301\302\300\"S\303_\304\"\305\306\307\300\"\310!@\262\"\211\301\303GZ\304\"P\305\311\312\313\300\"\314\315!\300#\316\211;\203= \317\320#\202C \321A@\"\266\202\206M \322\300\"#\321\300\323\"\205q \321\300\323\"\324=?\205q \325\300\"\211\205o \305\326\327\330\331#\"\262R\207" [(:export-options nil :back-end [cl-struct-org-export-backend md html ((bold . org-md-bold) (code . org-md-verbatim) (example-block . org-md-example-block) (export-block . org-md-export-block) (fixed-width . org-md-example-block) (headline . org-md-headline) (horizontal-rule . org-md-horizontal-rule) (inline-src-block . org-md-verbatim) (inner-template . org-md-inner-template) (italic . org-md-italic) (item . org-md-item) (keyword . org-md-keyword) (line-break . org-md-line-break) (link . org-md-link) (node-property . org-md-node-property) (paragraph . org-md-paragraph) (plain-list . org-md-plain-list) (plain-text . org-md-plain-text) (property-drawer . org-md-property-drawer) (quote-block . org-md-quote-block) (section . org-md-section) (src-block . org-md-example-block) (template . org-md-template) (verbatim . org-md-verbatim)) ((:md-footnote-format nil nil org-md-footnote-format) (:md-footnotes-section nil nil org-md-footnotes-section) (:md-headline-style nil nil org-md-headline-style)) ((:filter-parse-tree . org-md-separate-elements)) nil (109 "Export to Markdown" ((77 "To temporary buffer" (lambda ... ...)) (109 "To file" (lambda ... ...)) (111 "To file and open" (lambda ... ...))))] :translate-alist ((bold . org-md-bold) (code . org-md-verbatim) (example-block . org-md-example-block) (export-block . org-md-export-block) (fixed-width . org-md-example-block) (headline . org-md-headline) (horizontal-rule . org-md-horizontal-rule) (inline-src-block . org-md-verbatim) (inner-template . org-md-inner-template) (italic . org-md-italic) (item . org-md-item) (keyword . org-md-keyword) (line-break . org-md-line-break) (link . org-md-link) (node-property . org-md-node-property) (paragraph . org-md-paragraph) (plain-list . org-md-plain-list) (plain-text . org-md-plain-text) (property-drawer . org-md-property-drawer) (quote-block . org-md-quote-block) (section . org-md-section) (src-block . org-md-example-block) (template . org-md-template) (verbatim . org-md-verbatim) (bold . org-html-bold) (center-block . org-html-center-block) (clock . org-html-clock) (code . org-html-code) (drawer . org-html-drawer) (dynamic-block . org-html-dynamic-block) (entity . org-html-entity) (example-block . org-html-example-block) (export-block . org-html-export-block) (export-snippet . org-html-export-snippet) (fixed-width . org-html-fixed-width) (footnote-definition . org-html-footnote-definition) (footnote-reference . org-html-footnote-reference) (headline . org-html-headline) (horizontal-rule . org-html-horizontal-rule) (inline-src-block . org-html-inline-src-block) (inlinetask . org-html-inlinetask) (inner-template . org-html-inner-template) (italic . org-html-italic) (item . org-html-item) (keyword . org-html-keyword) (latex-environment . org-html-latex-environment) (latex-fragment . org-html-latex-fragment) (line-break . org-html-line-break) (link . org-html-link) (node-property . org-html-node-property) ...) :exported-data #s(hash-table size 4001 test eq rehash-size 1.5 rehash-threshold 0.8 data ((keyword (:key "TITLE" :value "TEST" :begin 1 :end 15 :post-blank 1 :post-affiliated 1 :parent (section (:begin 1 :end 32 :contents-begin 1 :contents-end 32 :post-blank 1 :post-affiliated 1 :parent ...) #4 (keyword ...)))) "" (keyword (:key "OPTIONS" :value "toc:t" :begin 15 :end 32 :post-blank 1 :post-affiliated 15 :parent (section (:begin 1 :end 32 :contents-begin 1 :contents-end 32 :post-blank 1 :post-affiliated 1 :parent ...) (keyword ...) #4))) "" (section (:begin 1 :end 32 :contents-begin 1 :contents-end 32 :post-blank 1 :post-affiliated 1 :parent (org-data nil #4 (headline ...))) (keyword (:key "TITLE" :value "TEST" :begin 1 :end 15 :post-blank 1 :post-affiliated 1 :parent #4)) (keyword (:key "OPTIONS" :value "toc:t" :begin 15 :end 32 :post-blank 1 :post-affiliated 15 :parent #4))) "\n" #("Headline 1" 0 10 (:parent (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title ... :parent ...)))) #("Headline 1" 0 10 (:parent (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title ... :parent ...)))) (#("Headline 1" 0 10 (:parent (headline ...)))) #("Headline 1" 0 10 (:parent (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title ... :parent ...)))) (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#("Headline 1" 0 10 ...)) :parent (org-data nil (section ... ... ...) #4))) #("\n<a id=\"org30c3ef9\"></a>\n\n# Headline 1\n\n" 28 38 (:parent (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title ... :parent ...)))) (org-data nil (section (:begin 1 :end 32 :contents-begin 1 :contents-end 32 :post-blank 1 :post-affiliated 1 :parent #4) (keyword (:key "TITLE" :value "TEST" :begin 1 :end 15 :post-blank 1 :post-affiliated 1 :parent #5)) (keyword (:key "OPTIONS" :value "toc:t" :begin 15 :end 32 :post-blank 1 :post-affiliated 15 :parent #5))) (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#("Headline 1" 0 10 ...)) :parent #4))) #("\n\n<a id=\"org30c3ef9\"></a>\n\n# Headline 1\n\n" 29 39 (:parent (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title ... :parent ...)))) ...)) :input-buffer "test.org" :input-file "/Users/yuezhu/test.org" :md-footnote-format "<sup>%s</sup>" :md-footnotes-section "%s%s" :md-headline-style atx :html-doctype "xhtml-strict" :html-container "div" :description nil :keywords nil :html-html5-fancy nil :html-link-use-abs-url nil :html-link-home "" :html-link-up "" :html-mathjax "" :html-postamble auto :html-preamble t :html-head "" :html-head-extra "" :subtitle nil :html-head-include-default-style t :html-head-include-scripts t ...) make-string org-export-get-relative-level 4 32 format "%d." org-export-get-headline-number last "[%s](#%s)" org-export-data-with-backend org-export-get-alt-title org-export-toc-entry-backend md :CUSTOM_ID get-text-property 0 plist-get org-export-get-reference :with-tags not-in-toc org-export-get-tags ":%s:" mapconcat identity ":"] 13 "\n\n(fn HEADLINE)"] ((headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#("Headline 1" 0 10 (:parent #1))) :parent (org-data nil (section (:begin 1 :end 32 :contents-begin 1 :contents-end 32 :post-blank 1 :post-affiliated 1 :parent #3) (keyword (:key "TITLE" :value "TEST" :begin 1 :end 15 :post-blank 1 :post-affiliated 1 :parent #4)) (keyword (:key "OPTIONS" :value "toc:t" :begin 15 :end 32 :post-blank 1 :post-affiliated 15 :parent #4))) #1)))) "\n") org-md--build-toc((:export-options nil :back-end [cl-struct-org-export-backend md html ((bold . org-md-bold) (code . org-md-verbatim) (example-block . org-md-example-block) (export-block . org-md-export-block) (fixed-width . org-md-example-block) (headline . org-md-headline) (horizontal-rule . org-md-horizontal-rule) (inline-src-block . org-md-verbatim) (inner-template . org-md-inner-template) (italic . org-md-italic) (item . org-md-item) (keyword . org-md-keyword) (line-break . org-md-line-break) (link . org-md-link) (node-property . org-md-node-property) (paragraph . org-md-paragraph) (plain-list . org-md-plain-list) (plain-text . org-md-plain-text) (property-drawer . org-md-property-drawer) (quote-block . org-md-quote-block) (section . org-md-section) (src-block . org-md-example-block) (template . org-md-template) (verbatim . org-md-verbatim)) ((:md-footnote-format nil nil org-md-footnote-format) (:md-footnotes-section nil nil org-md-footnotes-section) (:md-headline-style nil nil org-md-headline-style)) ((:filter-parse-tree . org-md-separate-elements)) nil (109 "Export to Markdown" ((77 "To temporary buffer" (lambda (a s v b) (org-md-export-as-markdown a s v))) (109 "To file" (lambda (a s v b) (org-md-export-to-markdown a s v))) (111 "To file and open" (lambda (a s v b) (if a (org-md-export-to-markdown t s v) (org-open-file ...))))))] :translate-alist ((bold . org-md-bold) (code . org-md-verbatim) (example-block . org-md-example-block) (export-block . org-md-export-block) (fixed-width . org-md-example-block) (headline . org-md-headline) (horizontal-rule . org-md-horizontal-rule) (inline-src-block . org-md-verbatim) (inner-template . org-md-inner-template) (italic . org-md-italic) (item . org-md-item) (keyword . org-md-keyword) (line-break . org-md-line-break) (link . org-md-link) (node-property . org-md-node-property) (paragraph . org-md-paragraph) (plain-list . org-md-plain-list) (plain-text . org-md-plain-text) (property-drawer . org-md-property-drawer) (quote-block . org-md-quote-block) (section . org-md-section) (src-block . org-md-example-block) (template . org-md-template) (verbatim . org-md-verbatim) (bold . org-html-bold) (center-block . org-html-center-block) (clock . org-html-clock) (code . org-html-code) (drawer . org-html-drawer) (dynamic-block . org-html-dynamic-block) (entity . org-html-entity) (example-block . org-html-example-block) (export-block . org-html-export-block) (export-snippet . org-html-export-snippet) (fixed-width . org-html-fixed-width) (footnote-definition . org-html-footnote-definition) (footnote-reference . org-html-footnote-reference) (headline . org-html-headline) (horizontal-rule . org-html-horizontal-rule) (inline-src-block . org-html-inline-src-block) (inlinetask . org-html-inlinetask) (inner-template . org-html-inner-template) (italic . org-html-italic) (item . org-html-item) (keyword . org-html-keyword) (latex-environment . org-html-latex-environment) (latex-fragment . org-html-latex-fragment) (line-break . org-html-line-break) (link . org-html-link) (node-property . org-html-node-property) ...) :exported-data #s(hash-table size 4001 test eq rehash-size 1.5 rehash-threshold 0.8 data ((keyword (:key "TITLE" :value "TEST" :begin 1 :end 15 :post-blank 1 :post-affiliated 1 :parent (section (:begin 1 :end 32 :contents-begin 1 :contents-end 32 :post-blank 1 :post-affiliated 1 :parent (org-data nil #4 (headline ...))) #2 (keyword (:key "OPTIONS" :value "toc:t" :begin 15 :end 32 :post-blank 1 :post-affiliated 15 :parent #4))))) "" (keyword (:key "OPTIONS" :value "toc:t" :begin 15 :end 32 :post-blank 1 :post-affiliated 15 :parent (section (:begin 1 :end 32 :contents-begin 1 :contents-end 32 :post-blank 1 :post-affiliated 1 :parent (org-data nil #4 (headline ...))) (keyword (:key "TITLE" :value "TEST" :begin 1 :end 15 :post-blank 1 :post-affiliated 1 :parent #4)) #2))) "" (section (:begin 1 :end 32 :contents-begin 1 :contents-end 32 :post-blank 1 :post-affiliated 1 :parent (org-data nil #2 (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#("Headline 1" 0 10 ...)) :parent #4)))) (keyword (:key "TITLE" :value "TEST" :begin 1 :end 15 :post-blank 1 :post-affiliated 1 :parent #2)) (keyword (:key "OPTIONS" :value "toc:t" :begin 15 :end 32 :post-blank 1 :post-affiliated 15 :parent #2))) "\n" #("Headline 1" 0 10 (:parent (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#2) :parent (org-data nil (section ... ... ...) #4))))) #("Headline 1" 0 10 (:parent (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#("Headline 1" 0 10 ...)) :parent (org-data nil (section ... ... ...) #4))))) (#("Headline 1" 0 10 (:parent (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title #2 :parent (org-data nil ... #5)))))) #("Headline 1" 0 10 (:parent (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#("Headline 1" 0 10 ...)) :parent (org-data nil (section ... ... ...) #4))))) (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#("Headline 1" 0 10 (:parent #2))) :parent (org-data nil (section (:begin 1 :end 32 :contents-begin 1 :contents-end 32 :post-blank 1 :post-affiliated 1 :parent #4) (keyword (:key "TITLE" :value "TEST" :begin 1 :end 15 :post-blank 1 :post-affiliated 1 :parent #5)) (keyword (:key "OPTIONS" :value "toc:t" :begin 15 :end 32 :post-blank 1 :post-affiliated 15 :parent #5))) #2))) #("\n<a id=\"org30c3ef9\"></a>\n\n# Headline 1\n\n" 28 38 (:parent (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#("Headline 1" 0 10 ...)) :parent (org-data nil (section ... ... ...) #4))))) (org-data nil (section (:begin 1 :end 32 :contents-begin 1 :contents-end 32 :post-blank 1 :post-affiliated 1 :parent #2) (keyword (:key "TITLE" :value "TEST" :begin 1 :end 15 :post-blank 1 :post-affiliated 1 :parent #3)) (keyword (:key "OPTIONS" :value "toc:t" :begin 15 :end 32 :post-blank 1 :post-affiliated 15 :parent #3))) (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#("Headline 1" 0 10 (:parent #3))) :parent #2))) #("\n\n<a id=\"org30c3ef9\"></a>\n\n# Headline 1\n\n" 29 39 (:parent (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#("Headline 1" 0 10 ...)) :parent (org-data nil (section ... ... ...) #4))))) ...)) :input-buffer "test.org" :input-file "/Users/yuezhu/test.org" :md-footnote-format "<sup>%s</sup>" :md-footnotes-section "%s%s" :md-headline-style atx :html-doctype "xhtml-strict" :html-container "div" :description nil :keywords nil :html-html5-fancy nil :html-link-use-abs-url nil :html-link-home "" :html-link-up "" :html-mathjax "" :html-postamble auto :html-preamble t :html-head "" :html-head-extra "" :subtitle nil :html-head-include-default-style t :html-head-include-scripts t ...) nil) org-md-inner-template(#("\n\n<a id=\"org30c3ef9\"></a>\n\n# Headline 1\n" 29 39 (:parent (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#("Headline 1" 0 10 (:parent #2))) :parent (org-data nil (section (:begin 1 :end 32 :contents-begin 1 :contents-end 32 :post-blank 1 :post-affiliated 1 :parent #4) (keyword (:key "TITLE" :value "TEST" :begin 1 :end 15 :post-blank 1 :post-affiliated 1 :parent #5)) (keyword (:key "OPTIONS" :value "toc:t" :begin 15 :end 32 :post-blank 1 :post-affiliated 15 :parent #5))) #2))))) (:export-options nil :back-end [cl-struct-org-export-backend md html ((bold . org-md-bold) (code . org-md-verbatim) (example-block . org-md-example-block) (export-block . org-md-export-block) (fixed-width . org-md-example-block) (headline . org-md-headline) (horizontal-rule . org-md-horizontal-rule) (inline-src-block . org-md-verbatim) (inner-template . org-md-inner-template) (italic . org-md-italic) (item . org-md-item) (keyword . org-md-keyword) (line-break . org-md-line-break) (link . org-md-link) (node-property . org-md-node-property) (paragraph . org-md-paragraph) (plain-list . org-md-plain-list) (plain-text . org-md-plain-text) (property-drawer . org-md-property-drawer) (quote-block . org-md-quote-block) (section . org-md-section) (src-block . org-md-example-block) (template . org-md-template) (verbatim . org-md-verbatim)) ((:md-footnote-format nil nil org-md-footnote-format) (:md-footnotes-section nil nil org-md-footnotes-section) (:md-headline-style nil nil org-md-headline-style)) ((:filter-parse-tree . org-md-separate-elements)) nil (109 "Export to Markdown" ((77 "To temporary buffer" (lambda (a s v b) (org-md-export-as-markdown a s v))) (109 "To file" (lambda (a s v b) (org-md-export-to-markdown a s v))) (111 "To file and open" (lambda (a s v b) (if a (org-md-export-to-markdown t s v) (org-open-file ...))))))] :translate-alist ((bold . org-md-bold) (code . org-md-verbatim) (example-block . org-md-example-block) (export-block . org-md-export-block) (fixed-width . org-md-example-block) (headline . org-md-headline) (horizontal-rule . org-md-horizontal-rule) (inline-src-block . org-md-verbatim) (inner-template . org-md-inner-template) (italic . org-md-italic) (item . org-md-item) (keyword . org-md-keyword) (line-break . org-md-line-break) (link . org-md-link) (node-property . org-md-node-property) (paragraph . org-md-paragraph) (plain-list . org-md-plain-list) (plain-text . org-md-plain-text) (property-drawer . org-md-property-drawer) (quote-block . org-md-quote-block) (section . org-md-section) (src-block . org-md-example-block) (template . org-md-template) (verbatim . org-md-verbatim) (bold . org-html-bold) (center-block . org-html-center-block) (clock . org-html-clock) (code . org-html-code) (drawer . org-html-drawer) (dynamic-block . org-html-dynamic-block) (entity . org-html-entity) (example-block . org-html-example-block) (export-block . org-html-export-block) (export-snippet . org-html-export-snippet) (fixed-width . org-html-fixed-width) (footnote-definition . org-html-footnote-definition) (footnote-reference . org-html-footnote-reference) (headline . org-html-headline) (horizontal-rule . org-html-horizontal-rule) (inline-src-block . org-html-inline-src-block) (inlinetask . org-html-inlinetask) (inner-template . org-html-inner-template) (italic . org-html-italic) (item . org-html-item) (keyword . org-html-keyword) (latex-environment . org-html-latex-environment) (latex-fragment . org-html-latex-fragment) (line-break . org-html-line-break) (link . org-html-link) (node-property . org-html-node-property) ...) :exported-data #s(hash-table size 4001 test eq rehash-size 1.5 rehash-threshold 0.8 data ((keyword (:key "TITLE" :value "TEST" :begin 1 :end 15 :post-blank 1 :post-affiliated 1 :parent (section (:begin 1 :end 32 :contents-begin 1 :contents-end 32 :post-blank 1 :post-affiliated 1 :parent (org-data nil #4 (headline ...))) #2 (keyword (:key "OPTIONS" :value "toc:t" :begin 15 :end 32 :post-blank 1 :post-affiliated 15 :parent #4))))) "" (keyword (:key "OPTIONS" :value "toc:t" :begin 15 :end 32 :post-blank 1 :post-affiliated 15 :parent (section (:begin 1 :end 32 :contents-begin 1 :contents-end 32 :post-blank 1 :post-affiliated 1 :parent (org-data nil #4 (headline ...))) (keyword (:key "TITLE" :value "TEST" :begin 1 :end 15 :post-blank 1 :post-affiliated 1 :parent #4)) #2))) "" (section (:begin 1 :end 32 :contents-begin 1 :contents-end 32 :post-blank 1 :post-affiliated 1 :parent (org-data nil #2 (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#("Headline 1" 0 10 ...)) :parent #4)))) (keyword (:key "TITLE" :value "TEST" :begin 1 :end 15 :post-blank 1 :post-affiliated 1 :parent #2)) (keyword (:key "OPTIONS" :value "toc:t" :begin 15 :end 32 :post-blank 1 :post-affiliated 15 :parent #2))) "\n" #("Headline 1" 0 10 (:parent (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#2) :parent (org-data nil (section ... ... ...) #4))))) #("Headline 1" 0 10 (:parent (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#("Headline 1" 0 10 ...)) :parent (org-data nil (section ... ... ...) #4))))) (#("Headline 1" 0 10 (:parent (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title #2 :parent (org-data nil ... #5)))))) #("Headline 1" 0 10 (:parent (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#("Headline 1" 0 10 ...)) :parent (org-data nil (section ... ... ...) #4))))) (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#("Headline 1" 0 10 (:parent #2))) :parent (org-data nil (section (:begin 1 :end 32 :contents-begin 1 :contents-end 32 :post-blank 1 :post-affiliated 1 :parent #4) (keyword (:key "TITLE" :value "TEST" :begin 1 :end 15 :post-blank 1 :post-affiliated 1 :parent #5)) (keyword (:key "OPTIONS" :value "toc:t" :begin 15 :end 32 :post-blank 1 :post-affiliated 15 :parent #5))) #2))) #("\n<a id=\"org30c3ef9\"></a>\n\n# Headline 1\n\n" 28 38 (:parent (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#("Headline 1" 0 10 ...)) :parent (org-data nil (section ... ... ...) #4))))) (org-data nil (section (:begin 1 :end 32 :contents-begin 1 :contents-end 32 :post-blank 1 :post-affiliated 1 :parent #2) (keyword (:key "TITLE" :value "TEST" :begin 1 :end 15 :post-blank 1 :post-affiliated 1 :parent #3)) (keyword (:key "OPTIONS" :value "toc:t" :begin 15 :end 32 :post-blank 1 :post-affiliated 15 :parent #3))) (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#("Headline 1" 0 10 (:parent #3))) :parent #2))) #("\n\n<a id=\"org30c3ef9\"></a>\n\n# Headline 1\n\n" 29 39 (:parent (headline (:raw-value "Headline 1" :begin 32 :end 44 :pre-blank 0 :contents-begin nil :contents-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 1 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 32 :title (#("Headline 1" 0 10 ...)) :parent (org-data nil (section ... ... ...) #4))))) ...)) :input-buffer "test.org" :input-file "/Users/yuezhu/test.org" :md-footnote-format "<sup>%s</sup>" :md-footnotes-section "%s%s" :md-headline-style atx :html-doctype "xhtml-strict" :html-container "div" :description nil :keywords nil :html-html5-fancy nil :html-link-use-abs-url nil :html-link-home "" :html-link-up "" :html-mathjax "" :html-postamble auto :html-preamble t :html-head "" :html-head-extra "" :subtitle nil :html-head-include-default-style t :html-head-include-scripts t ...)) org-export-as(md nil nil nil (:output-file "test.md")) org-export-to-file(md "test.md" nil nil nil) org-md-export-to-markdown(nil nil nil) (lambda (a s v b) (org-md-export-to-markdown a s v))(nil nil nil nil) org-export-dispatch(nil) funcall-interactively(org-export-dispatch nil) call-interactively(org-export-dispatch nil nil) command-execute(org-export-dispatch)
Org version
Org mode version 9.1.9 (9.1.9-14-g1a1e47-elpa)
This seems to be an issue of ox-md.el which is shipped together with Org mode.
ox-md.el
OK. Thanks for reporting though!
When exporting an Org file with
#+OPTIONS: toc:t
in the beginning, an error would occur and no markdown would be exported.Using this simple Org file can reproduce this problem
Headline 1
Debug trace
Org version