wikidb.title_of

wikidb

title_of(content) -> title

Find the first ATX heading in a document

This reads lines, not the parse tree. A # line inside a fenced code block counts when it comes before the real heading.