hledger/tools/pandoc-drop-toc.lua
Everett Hildenbrandt 946fa1d498 tools/pandoc-{site,drop-toc}, Shake, site/, doc/: switch from bulletlist to metainline toc marker
Files `site/doc/{1.0,1.1}/hledger-ui.md` had to be treated specially because
thay had some other elements inside the same `BulletList` that the `toc` lived
inside. Because only the first element of the `BulletList` is compared, these
extra HTML elements were either dropped or replaced with a TOC at compile time.
By switching to the meta-inline `\$toc\$`, they started to persist into the
resulting HTML. The fix was to drop them from the source markdown.
2018-05-21 08:35:49 -07:00

7 lines
226 B
Lua

function Para(p)
if not p.content[1] then return p end
if not (p.content[1].t == "Str") then return p end
if not (p.content[1].text == "$toc$") then return p end
return pandoc.Null()
end