You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* TOC
:PROPERTIES:
:TOC: :include all :ignore (this)
:END:
:CONTENTS:
:END:
* one
*
Note the last headline has no text. This causes the string-match-p call in line 332 to fail. The following is the top few stack frames of the debugger:
Applying the following patch can work around the error:
modified org-make-toc.el
@@ -330,7 +330,7 @@ with the destination of the published file."
;; NOTE: The "COMMENT" keyword is not returned as the to-do keyword
;; by `org-heading-components', so it can't be tested as a keyword.
(string-match-p (rx bos "COMMENT" (or blank eos))
- (nth 4 (org-heading-components))))+ (or (nth 4 (org-heading-components)) "")))
(funcall org-make-toc-link-type-fn)))
(entry-match (property value)
(when-let* ((found-value (entry-property property)))
but it can also produce incorrect TOC with the org buffers like below:
* TOC
:PROPERTIES:
:TOC: :include all :ignore (this)
:END:
:CONTENTS:
- [[#four][four]]
:END:
*
** four
The text was updated successfully, but these errors were encountered:
If links can be generated to the "anonymous" headings without too much effort for you, perhaps we can have "placeholder" entries in place of such anonymous headings in the TOC?
An error message would be good enough otherwise. An org doc with such headings is unfinished and thoese headings must to be fixed anyway.
I don't know what links GitHub's renderer generates for anonymous headings. Maybe the best approach would be to show a warning at TOC-generation time and omit that entry from the TOC.
The org buffer to reproduce:
Note the last headline has no text. This causes the
string-match-p
call in line 332 to fail. The following is the top few stack frames of the debugger:Applying the following patch can work around the error:
but it can also produce incorrect TOC with the org buffers like below:
The text was updated successfully, but these errors were encountered: