@@ -269,10 +269,13 @@ elementToListItem opts (Sec lev num (id',classes,_) headerText subsecs)
269 let subList = if null subHeads
269 let subList = if null subHeads
270 then mempty
270 then mempty
271 else unordList opts subHeads
271 else unordList opts subHeads
272+ -- in reveal.js, we need #/apples, not #apples:
273+ let revealSlash = ['/' | writerSlideVariant opts == RevealJsSlides]
272 return $ Just
274 return $ Just
273 $ if null id'
275 $ if null id'
274 then (H.a $ toHtml txt) >> subList
276 then (H.a $ toHtml txt) >> subList
277+ else (H.a ! A.href (toValue $ "#" ++ revealSlash ++
275− else (H.a ! A.href (toValue $ "#" ++ writerIdentifierPrefix opts ++ id')
278+ writerIdentifierPrefix opts ++ id')
276 $ toHtml txt) >> subList
279 $ toHtml txt) >> subList
277elementToListItem _ _ = return Nothing
280elementToListItem _ _ = return Nothing
@@ -477,9 +480,12 @@ blockToHtml opts (Header level (ident,_,_) lst) = do
477 then (H.span ! A.class_ "header-section-number" $ toHtml
480 then (H.span ! A.class_ "header-section-number" $ toHtml
478 $ showSecNum secnum) >> strToHtml " " >> contents
481 $ showSecNum secnum) >> strToHtml " " >> contents
479 else contents
482 else contents
483+ let revealSlash = ['/' | writerSlideVariant opts == RevealJsSlides]
480 let contents'' = if writerTableOfContents opts && not (null ident)
484 let contents'' = if writerTableOfContents opts && not (null ident)
481 then H.a ! A.href (toValue $
485 then H.a ! A.href (toValue $
486+ '#' : revealSlash ++
482− '#' : writerIdentifierPrefix opts ++ ident) $ contents'
487+ writerIdentifierPrefix opts ++
483 else contents'
489 else contents'
484 return $ case level of
490 return $ case level of
485 1 -> H.h1 contents''
491 1 -> H.h1 contents''
@@ -701,7 +707,11 @@ inlineToHtml opts inline =
701 return $ obfuscateLink opts (renderHtml linkText) s
707 return $ obfuscateLink opts (renderHtml linkText) s
702 (Link txt (s,tit)) -> do
708 (Link txt (s,tit)) -> do
703 linkText <- inlineListToHtml opts txt
709 linkText <- inlineListToHtml opts txt
711+ '#':xs | writerSlideVariant opts ==
712+ RevealJsSlides -> '#':'/':xs
704− let link = H.a ! A.href (toValue s) $ linkText
714+ let link = H.a ! A.href (toValue s') $ linkText
705 return $ if null tit
715 return $ if null tit
706 then link
716 then link
707 else link ! A.title (toValue tit)
717 else link ! A.title (toValue tit)
@@ -732,7 +742,10 @@ inlineToHtml opts inline =
732 htmlContents <- blockListToNote opts ref contents
742 htmlContents <- blockListToNote opts ref contents
733 -- push contents onto front of notes
743 -- push contents onto front of notes
734 put $ st {stNotes = (htmlContents:notes)}
744 put $ st {stNotes = (htmlContents:notes)}
745+ let revealSlash = ['/' | writerSlideVariant opts
735 let link = H.a ! A.href (toValue $ "#" ++
747 let link = H.a ! A.href (toValue $ "#" ++
736 writerIdentifierPrefix opts ++ "fn" ++ ref)
749 writerIdentifierPrefix opts ++ "fn" ++ ref)
737 ! A.class_ "footnoteRef"
750 ! A.class_ "footnoteRef"
738 ! prefixedId opts ("fnref" ++ ref)
751 ! prefixedId opts ("fnref" ++ ref)