Derek Chen-Becker <[email protected]> writes: > Attached is a patch which conditionally formats TOC links depending on > whether they're images. I promoted the default link transcoder into its own > defun to reduce duplication. I added some new unit tests and all existing > tests pass.
Thanks! Could you also add a news entry? This is technically a breaking change that may affect users. > Subject: [PATCH] Generate images in TOC for HTML export > > * lisp/ox.el (org-export-toc-entry-backend): Extract the lambda for link > formatting into a new `org-export-toc-default-link-transcoder' defun for > use in other exporters. > * lisp/ox-html.el (org-html--format-toc-headline): Format image links for > the TOC using `org-html-link', but all other link types maintain formatting > using the new `org-export-toc-default-link-transcoder'. > * testing/lisp/test-ox-html.el (org-html/test-toc-images, > org-html/test-toc-links): Create new unit tests to exercise the conditional > formatting of TOC links for image and non-image links. > > Prior to this, image links would be rendered in headers, but would be > converted into a plain text filename in the TOC. It is also a good idea to add Reported-by: and Link: entries to the commit message. -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>
