@@ -117,7 +117,7 @@ elementToListItem opts (Sec headerText subsecs) = do
117 let subList = if null subHeads
117 let subList = if null subHeads
118 then noHtml
118 then noHtml
119 else unordList subHeads
119 else unordList subHeads
120− return $ (anchor ! [href ("#" ++ id)] $ txt) +++ subList
120+ return $ (anchor ! [href ("#" ++ id), identifier ("TOC-" ++ id)] $ txt) +++ subList
122-- | Convert list of Note blocks to a footnote <div>.
122-- | Convert list of Note blocks to a footnote <div>.
123-- Assumes notes are sorted.
123-- Assumes notes are sorted.
@@ -175,17 +175,17 @@ inlineListToIdentifier [] = ""
175inlineListToIdentifier (x:xs) =
175inlineListToIdentifier (x:xs) =
176 xAsText ++ inlineListToIdentifier xs
176 xAsText ++ inlineListToIdentifier xs
177 where xAsText = case x of
177 where xAsText = case x of
178− Str s -> s
178+ Str s -> map toLower s
179 Emph lst -> inlineListToIdentifier lst
179 Emph lst -> inlineListToIdentifier lst
180 Strong lst -> inlineListToIdentifier lst
180 Strong lst -> inlineListToIdentifier lst
181 Quoted _ lst -> inlineListToIdentifier lst
181 Quoted _ lst -> inlineListToIdentifier lst
182 Code s -> s
182 Code s -> s
183− Space -> "_"
183+ Space -> "-"
184 EmDash -> "--"
184 EmDash -> "--"
185 EnDash -> "-"
185 EnDash -> "-"
186 Apostrophe -> ""
186 Apostrophe -> ""
187 Ellipses -> "..."
187 Ellipses -> "..."
188− LineBreak -> "_"
188+ LineBreak -> "-"
189 TeX _ -> ""
189 TeX _ -> ""
190 HtmlInline _ -> ""
190 HtmlInline _ -> ""
191 Link lst _ -> inlineListToIdentifier lst
191 Link lst _ -> inlineListToIdentifier lst
@@ -242,7 +242,7 @@ blockToHtml opts block =
242 6 -> h6 contents ! attribs
242 6 -> h6 contents ! attribs
243 _ -> paragraph contents ! attribs
243 _ -> paragraph contents ! attribs
244 let headerHtml' = if writerTableOfContents opts
244 let headerHtml' = if writerTableOfContents opts
245− then anchor ! [href "#toc"] $
245+ then anchor ! [href ("#TOC-" ++ id)] $
246 headerHtml
246 headerHtml
247 else headerHtml
247 else headerHtml
248 return headerHtml'
248 return headerHtml'