View Single Post
Old 07-11-2020, 10:47 AM   #1
playful
Mammal
playful has become one with the cosmosplayful has become one with the cosmosplayful has become one with the cosmosplayful has become one with the cosmosplayful has become one with the cosmosplayful has become one with the cosmosplayful has become one with the cosmosplayful has become one with the cosmosplayful has become one with the cosmosplayful has become one with the cosmosplayful has become one with the cosmos
 
playful's Avatar
 
Posts: 126
Karma: 21380
Join Date: Oct 2010
Location: Right Here
Device: Onyx Note Pro, Kindle DXG
Question [SOLVED] Possible to use <title> tags as TOC headings?

Hi there,

A bit of a Sigil-noobie question.

Working with 1000+ html files.
Each has a proper title tag such as <title>1 - it all began here</title> but no h1, h2 etc. tags.

Out of the box, when generating the TOC, is there a way to make Sigil take the <title> tags into account?

As a workaround, I've added some <h1> tags to the 1000+ pages with a simple regex-replace, but that's not really my first choice.

Thanks!

p.s.
For reference if someone on the same track needs that workaround:
Search: (?s)(<title>([^<]+).*?<body>)
Replace: \1\n<h1>\2</h1>\n

Last edited by playful; 07-11-2020 at 11:50 AM. Reason: Solved
playful is offline   Reply With Quote