git.iko.soy/typeable/pandoc
on master help sign in
Provide explicit separate functions for HTML 4 and 5.
fce0a60John MacFarlane
pandoc.cabal+5−3
@@ -36,7 +36,7 @@ Description: Pandoc is a Haskell library for converting from one markup
36 only adding a reader or writer.
36 only adding a reader or writer.
37Data-Files:
37Data-Files:
38 -- templates
38 -- templates
39− data/templates/default.html
39+ data/templates/default.html4
40 data/templates/default.html5
40 data/templates/default.html5
41 data/templates/default.docbook
41 data/templates/default.docbook
42 data/templates/default.docbook5
42 data/templates/default.docbook5
@@ -150,7 +150,8 @@ Extra-Source-Files:
150 tests/tables.dokuwiki
150 tests/tables.dokuwiki
151 tests/tables.zimwiki
151 tests/tables.zimwiki
152 tests/tables.icml
152 tests/tables.icml
153− tests/tables.html
153+ tests/tables.html4
154+ tests/tables.html5
154 tests/tables.latex
155 tests/tables.latex
155 tests/tables.man
156 tests/tables.man
156 tests/tables.plain
157 tests/tables.plain
@@ -172,7 +173,8 @@ Extra-Source-Files:
172 tests/writer.context
173 tests/writer.context
173 tests/writer.docbook
174 tests/writer.docbook
174 tests/writer.docbook5
175 tests/writer.docbook5
175− tests/writer.html
176+ tests/writer.html4
177+ tests/writer.html5
176 tests/writer.man
178 tests/writer.man
177 tests/writer.markdown
179 tests/writer.markdown
178 tests/writer.plain
180 tests/writer.plain
pandoc.hs+2−8
@@ -111,7 +111,6 @@ convertWithOpts opts args = do
111 , optSectionDivs = sectionDivs
111 , optSectionDivs = sectionDivs
112 , optIncremental = incremental
112 , optIncremental = incremental
113 , optSelfContained = selfContained
113 , optSelfContained = selfContained
114− , optHtml5 = html5
115 , optHtmlQTags = htmlQTags
114 , optHtmlQTags = htmlQTags
116 , optHighlightStyle = highlightStyle
115 , optHighlightStyle = highlightStyle
117 , optTopLevelDivision = topLevelDivision
116 , optTopLevelDivision = topLevelDivision
@@ -188,13 +187,11 @@ convertWithOpts opts args = do
188 (if any isURI sources
187 (if any isURI sources
189 then "html"
188 then "html"
190 else "markdown") sources
189 else "markdown") sources
191− "html4" -> "html"
192 x -> x
190 x -> x
193
191
194 let writerName' = case map toLower writerName of
192 let writerName' = case map toLower writerName of
195 [] -> defaultWriterName outputFile
193 [] -> defaultWriterName outputFile
196 "epub2" -> "epub"
194 "epub2" -> "epub"
197− "html4" -> "html"
198 x -> x
195 x -> x
199 let format = takeWhile (`notElem` ['+','-'])
196 let format = takeWhile (`notElem` ['+','-'])
200 $ takeFileName writerName' -- in case path to lua script
197 $ takeFileName writerName' -- in case path to lua script
@@ -203,7 +200,7 @@ convertWithOpts opts args = do
203
200
204 let laTeXOutput = format `elem` ["latex", "beamer"]
201 let laTeXOutput = format `elem` ["latex", "beamer"]
205 let conTeXtOutput = format == "context"
202 let conTeXtOutput = format == "context"
206− let html5Output = format == "html5"
203+ let html5Output = format == "html5" || format == "html"
207
204
208 -- disabling the custom writer for now
205 -- disabling the custom writer for now
209 writer <- if ".lua" `isSuffixOf` format
206 writer <- if ".lua" `isSuffixOf` format
@@ -313,7 +310,6 @@ convertWithOpts opts args = do
313 writerIdentifierPrefix = idPrefix,
310 writerIdentifierPrefix = idPrefix,
314 writerSourceURL = sourceURL,
311 writerSourceURL = sourceURL,
315 writerUserDataDir = datadir,
312 writerUserDataDir = datadir,
316− writerHtml5 = html5,
317 writerHtmlQTags = htmlQTags,
313 writerHtmlQTags = htmlQTags,
318 writerTopLevelDivision = topLevelDivision,
314 writerTopLevelDivision = topLevelDivision,
319 writerListings = listings,
315 writerListings = listings,
@@ -413,7 +409,7 @@ convertWithOpts opts args = do
413 err 43 "Error producing PDF"
409 err 43 "Error producing PDF"
414 | otherwise -> do
410 | otherwise -> do
415 let htmlFormat = format `elem`
411 let htmlFormat = format `elem`
416− ["html","html5","s5","slidy","slideous","dzslides","revealjs"]
412+ ["html","html4","html5","s5","slidy","slideous","dzslides","revealjs"]
417 selfcontain = if selfContained && htmlFormat
413 selfcontain = if selfContained && htmlFormat
418 then makeSelfContained writerOptions media
414 then makeSelfContained writerOptions media
419 else return
415 else return
@@ -523,7 +519,6 @@ data Opt = Opt
523 , optSectionDivs :: Bool -- ^ Put sections in div tags in HTML
519 , optSectionDivs :: Bool -- ^ Put sections in div tags in HTML
524 , optIncremental :: Bool -- ^ Use incremental lists in Slidy/Slideous/S5
520 , optIncremental :: Bool -- ^ Use incremental lists in Slidy/Slideous/S5
525 , optSelfContained :: Bool -- ^ Make HTML accessible offline
521 , optSelfContained :: Bool -- ^ Make HTML accessible offline
526− , optHtml5 :: Bool -- ^ Produce HTML5 in HTML
527 , optHtmlQTags :: Bool -- ^ Use <q> tags in HTML
522 , optHtmlQTags :: Bool -- ^ Use <q> tags in HTML
528 , optHighlightStyle :: Maybe Style -- ^ Style to use for highlighted code
523 , optHighlightStyle :: Maybe Style -- ^ Style to use for highlighted code
529 , optTopLevelDivision :: TopLevelDivision -- ^ Type of the top-level divisions
524 , optTopLevelDivision :: TopLevelDivision -- ^ Type of the top-level divisions
@@ -583,7 +578,6 @@ defaultOpts = Opt
583 , optSectionDivs = False
578 , optSectionDivs = False
584 , optIncremental = False
579 , optIncremental = False
585 , optSelfContained = False
580 , optSelfContained = False
586− , optHtml5 = False
587 , optHtmlQTags = False
581 , optHtmlQTags = False
588 , optHighlightStyle = Just pygments
582 , optHighlightStyle = Just pygments
589 , optTopLevelDivision = TopLevelDefault
583 , optTopLevelDivision = TopLevelDefault
src/Text/Pandoc.hs+14−13
@@ -99,8 +99,10 @@ module Text.Pandoc
99 , writeLaTeX
99 , writeLaTeX
100 , writeConTeXt
100 , writeConTeXt
101 , writeTexinfo
101 , writeTexinfo
102− , writeHtml
102+ , writeHtml4
103− , writeHtmlString
103+ , writeHtml4String
104+ , writeHtml5
105+ , writeHtml5String
104 , writeICML
106 , writeICML
105 , writeDocbook
107 , writeDocbook
106 , writeOPML
108 , writeOPML
@@ -281,23 +283,21 @@ writers = [
281 ,("epub3" , ByteStringWriter $ \o ->
283 ,("epub3" , ByteStringWriter $ \o ->
282 writeEPUB o{ writerEpubVersion = Just EPUB3 })
284 writeEPUB o{ writerEpubVersion = Just EPUB3 })
283 ,("fb2" , StringWriter writeFB2)
285 ,("fb2" , StringWriter writeFB2)
284− ,("html" , StringWriter writeHtmlString)
286+ ,("html" , StringWriter writeHtml5String)
287+ ,("html4" , StringWriter writeHtml4String)
285− ,("html5" , StringWriter $ \o ->
288+ ,("html5" , StringWriter writeHtml5String)
286− writeHtmlString o{ writerHtml5 = True })
287 ,("icml" , StringWriter writeICML)
289 ,("icml" , StringWriter writeICML)
288 ,("s5" , StringWriter $ \o ->
290 ,("s5" , StringWriter $ \o ->
289− writeHtmlString o{ writerSlideVariant = S5Slides
291+ writeHtml4String o{ writerSlideVariant = S5Slides
290− , writerTableOfContents = False })
292+ , writerTableOfContents = False })
291 ,("slidy" , StringWriter $ \o ->
293 ,("slidy" , StringWriter $ \o ->
292− writeHtmlString o{ writerSlideVariant = SlidySlides })
294+ writeHtml4String o{ writerSlideVariant = SlidySlides })
293 ,("slideous" , StringWriter $ \o ->
295 ,("slideous" , StringWriter $ \o ->
294− writeHtmlString o{ writerSlideVariant = SlideousSlides })
296+ writeHtml4String o{ writerSlideVariant = SlideousSlides })
295 ,("dzslides" , StringWriter $ \o ->
297 ,("dzslides" , StringWriter $ \o ->
296− writeHtmlString o{ writerSlideVariant = DZSlides
298+ writeHtml5String o{ writerSlideVariant = DZSlides })
297− , writerHtml5 = True })
298 ,("revealjs" , StringWriter $ \o ->
299 ,("revealjs" , StringWriter $ \o ->
299− writeHtmlString o{ writerSlideVariant = RevealJsSlides
300+ writeHtml5String o{ writerSlideVariant = RevealJsSlides })
300− , writerHtml5 = True })
301 ,("docbook" , StringWriter writeDocbook)
301 ,("docbook" , StringWriter writeDocbook)
302 ,("docbook5" , StringWriter $ \o ->
302 ,("docbook5" , StringWriter $ \o ->
303 writeDocbook o{ writerDocbook5 = True })
303 writeDocbook o{ writerDocbook5 = True })
@@ -342,6 +342,7 @@ getDefaultExtensions "html" = extensionsFromList
342 [Ext_auto_identifiers,
342 [Ext_auto_identifiers,
343 Ext_native_divs,
343 Ext_native_divs,
344 Ext_native_spans]
344 Ext_native_spans]
345+getDefaultExtensions "html4" = getDefaultExtensions "html"
345getDefaultExtensions "html5" = getDefaultExtensions "html"
346getDefaultExtensions "html5" = getDefaultExtensions "html"
346getDefaultExtensions "epub" = extensionsFromList
347getDefaultExtensions "epub" = extensionsFromList
347 [Ext_raw_html,
348 [Ext_raw_html,
src/Text/Pandoc/Options.hs−2
@@ -168,7 +168,6 @@ data WriterOptions = WriterOptions
168 , writerUserDataDir :: Maybe FilePath -- ^ Path of user data directory
168 , writerUserDataDir :: Maybe FilePath -- ^ Path of user data directory
169 , writerCiteMethod :: CiteMethod -- ^ How to print cites
169 , writerCiteMethod :: CiteMethod -- ^ How to print cites
170 , writerDocbook5 :: Bool -- ^ Produce DocBook5
170 , writerDocbook5 :: Bool -- ^ Produce DocBook5
171− , writerHtml5 :: Bool -- ^ Produce HTML5
172 , writerHtmlQTags :: Bool -- ^ Use @<q>@ tags for quotes in HTML
171 , writerHtmlQTags :: Bool -- ^ Use @<q>@ tags for quotes in HTML
173 , writerBeamer :: Bool -- ^ Produce beamer LaTeX slide show
172 , writerBeamer :: Bool -- ^ Produce beamer LaTeX slide show
174 , writerSlideLevel :: Maybe Int -- ^ Force header level of slides
173 , writerSlideLevel :: Maybe Int -- ^ Force header level of slides
@@ -210,7 +209,6 @@ instance Default WriterOptions where
210 , writerUserDataDir = Nothing
209 , writerUserDataDir = Nothing
211 , writerCiteMethod = Citeproc
210 , writerCiteMethod = Citeproc
212 , writerDocbook5 = False
211 , writerDocbook5 = False
213− , writerHtml5 = False
214 , writerHtmlQTags = False
212 , writerHtmlQTags = False
215 , writerBeamer = False
213 , writerBeamer = False
216 , writerSlideLevel = Nothing
214 , writerSlideLevel = Nothing
src/Text/Pandoc/Templates.hs+1
@@ -60,6 +60,7 @@ getDefaultTemplate user writer = do
60 "docx" -> return $ Right ""
60 "docx" -> return $ Right ""
61 "fb2" -> return $ Right ""
61 "fb2" -> return $ Right ""
62 "odt" -> getDefaultTemplate user "opendocument"
62 "odt" -> getDefaultTemplate user "opendocument"
63+ "html" -> getDefaultTemplate user "html5"
63 "markdown_strict" -> getDefaultTemplate user "markdown"
64 "markdown_strict" -> getDefaultTemplate user "markdown"
64 "multimarkdown" -> getDefaultTemplate user "markdown"
65 "multimarkdown" -> getDefaultTemplate user "markdown"
65 "markdown_github" -> getDefaultTemplate user "markdown"
66 "markdown_github" -> getDefaultTemplate user "markdown"
src/Text/Pandoc/Writers/CommonMark.hs+2−2
@@ -31,7 +31,7 @@ CommonMark: <http://commonmark.org>
31-}
31-}
32module Text.Pandoc.Writers.CommonMark (writeCommonMark) where
32module Text.Pandoc.Writers.CommonMark (writeCommonMark) where
33
33
34−import Text.Pandoc.Writers.HTML (writeHtmlString)
34+import Text.Pandoc.Writers.HTML (writeHtml5String)
35import Text.Pandoc.Definition
35import Text.Pandoc.Definition
36import Text.Pandoc.Shared (isTightList, linesToPara)
36import Text.Pandoc.Shared (isTightList, linesToPara)
37import Text.Pandoc.Templates (renderTemplate')
37import Text.Pandoc.Templates (renderTemplate')
@@ -138,7 +138,7 @@ blockToNodes (DefinitionList items) ns = blockToNodes (BulletList items') ns
138 dlToBullet (term, xs) =
138 dlToBullet (term, xs) =
139 Para term : concat xs
139 Para term : concat xs
140blockToNodes t@(Table _ _ _ _ _) ns = do
140blockToNodes t@(Table _ _ _ _ _) ns = do
141− s <- writeHtmlString def $! Pandoc nullMeta [t]
141+ s <- writeHtml5String def $! Pandoc nullMeta [t]
142 return (node (HTML_BLOCK (T.pack $! s)) [] : ns)
142 return (node (HTML_BLOCK (T.pack $! s)) [] : ns)
143blockToNodes Null ns = return ns
143blockToNodes Null ns = return ns
144
144
src/Text/Pandoc/Writers/EPUB.hs+6−5
@@ -59,7 +59,7 @@ import Control.Monad (mplus, when, zipWithM)
59import Text.XML.Light ( unode, Element(..), unqual, Attr(..), add_attrs
59import Text.XML.Light ( unode, Element(..), unqual, Attr(..), add_attrs
60 , strContent, lookupAttr, Node(..), QName(..), parseXML
60 , strContent, lookupAttr, Node(..), QName(..), parseXML
61 , onlyElems, node, ppElement)
61 , onlyElems, node, ppElement)
62−import Text.Pandoc.Writers.HTML ( writeHtml )
62+import Text.Pandoc.Writers.HTML ( writeHtml4, writeHtml5 )
63import Data.Char ( toLower, isDigit, isAlphaNum )
63import Data.Char ( toLower, isDigit, isAlphaNum )
64import Text.Pandoc.MIME (MimeType, getMimeType, extensionFromMimeType)
64import Text.Pandoc.MIME (MimeType, getMimeType, extensionFromMimeType)
65import Text.Blaze.Html.Renderer.Utf8 (renderHtml)
65import Text.Blaze.Html.Renderer.Utf8 (renderHtml)
@@ -361,13 +361,15 @@ pandocToEPUB opts doc@(Pandoc meta _) = do
361 : writerVariables opts
361 : writerVariables opts
362 let opts' = opts{ writerEmailObfuscation = NoObfuscation
362 let opts' = opts{ writerEmailObfuscation = NoObfuscation
363 , writerSectionDivs = True
363 , writerSectionDivs = True
364− , writerHtml5 = epub3
365 , writerVariables = vars
364 , writerVariables = vars
366 , writerHTMLMathMethod =
365 , writerHTMLMathMethod =
367 if epub3
366 if epub3
368 then MathML Nothing
367 then MathML Nothing
369 else writerHTMLMathMethod opts
368 else writerHTMLMathMethod opts
370 , writerWrapText = WrapAuto }
369 , writerWrapText = WrapAuto }
370+ let writeHtml = if epub3
371+ then writeHtml5
372+ else writeHtml4
371 metadata <- getEPUBMetadata opts' meta
373 metadata <- getEPUBMetadata opts' meta
372
374
373 -- cover page
375 -- cover page
@@ -376,7 +378,7 @@ pandocToEPUB opts doc@(Pandoc meta _) = do
376 Nothing -> return ([],[])
378 Nothing -> return ([],[])
377 Just img -> do
379 Just img -> do
378 let coverImage = "media/" ++ takeFileName img
380 let coverImage = "media/" ++ takeFileName img
379− cpContent <- renderHtml <$> (lift $ writeHtml
381+ cpContent <- renderHtml <$> (lift $ writeHtml
380 opts'{ writerVariables = ("coverpage","true"):vars }
382 opts'{ writerVariables = ("coverpage","true"):vars }
381 (Pandoc meta [RawBlock (Format "html") $ "<div id=\"cover-image\">\n<img src=\"" ++ coverImage ++ "\" alt=\"cover image\" />\n</div>"]))
383 (Pandoc meta [RawBlock (Format "html") $ "<div id=\"cover-image\">\n<img src=\"" ++ coverImage ++ "\" alt=\"cover image\" />\n</div>"]))
382 imgContent <- lift $ P.readFileLazy img
384 imgContent <- lift $ P.readFileLazy img
@@ -484,8 +486,7 @@ pandocToEPUB opts doc@(Pandoc meta _) = do
484 Chapter mbnum $ walk fixInternalReferences bs)
486 Chapter mbnum $ walk fixInternalReferences bs)
485 chapters'
487 chapters'
486
488
487− let chapToEntry :: PandocMonad m => Int -> Chapter -> m Entry
488− chapToEntry num (Chapter mbnum bs) =
489+ let chapToEntry num (Chapter mbnum bs) =
489 (mkEntry (showChapter num) . renderHtml) <$>
490 (mkEntry (showChapter num) . renderHtml) <$>
490 (writeHtml opts'{ writerNumberOffset =
491 (writeHtml opts'{ writerNumberOffset =
491 fromMaybe [] mbnum }
492 fromMaybe [] mbnum }
src/Text/Pandoc/Writers/HTML.hs+74−43
@@ -28,7 +28,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28
28
29Conversion of 'Pandoc' documents to HTML.
29Conversion of 'Pandoc' documents to HTML.
30-}
30-}
31−module Text.Pandoc.Writers.HTML ( writeHtml , writeHtmlString ) where
31+module Text.Pandoc.Writers.HTML (
32+ writeHtml4, writeHtml4String,
33+ writeHtml5, writeHtml5String ) where
32import Text.Pandoc.Definition
34import Text.Pandoc.Definition
33import Text.Pandoc.Walk
35import Text.Pandoc.Walk
34import Data.Monoid ((<>))
36import Data.Monoid ((<>))
@@ -80,12 +82,13 @@ data WriterState = WriterState
80 , stHighlighting :: Bool -- ^ Syntax highlighting is used
82 , stHighlighting :: Bool -- ^ Syntax highlighting is used
81 , stSecNum :: [Int] -- ^ Number of current section
83 , stSecNum :: [Int] -- ^ Number of current section
82 , stElement :: Bool -- ^ Processing an Element
84 , stElement :: Bool -- ^ Processing an Element
85+ , stHtml5 :: Bool -- ^ Use HTML5
83 }
86 }
84
87
85defaultWriterState :: WriterState
88defaultWriterState :: WriterState
86defaultWriterState = WriterState {stNotes= [], stMath = False, stQuotes = False,
89defaultWriterState = WriterState {stNotes= [], stMath = False, stQuotes = False,
87 stHighlighting = False, stSecNum = [],
90 stHighlighting = False, stSecNum = [],
88− stElement = False}
91+ stElement = False, stHtml5 = False}
89
92
90-- Helpers to render HTML with the appropriate function.
93-- Helpers to render HTML with the appropriate function.
91
94
@@ -102,19 +105,35 @@ nl opts = if writerWrapText opts == WrapNone
102 then mempty
105 then mempty
103 else preEscapedString "\n"
106 else preEscapedString "\n"
104
107
105−-- | Convert Pandoc document to Html string.
108+-- | Convert Pandoc document to Html 5 string.
109+writeHtml5String :: PandocMonad m => WriterOptions -> Pandoc -> m String
110+writeHtml5String = writeHtmlString' True
111+
112+-- | Convert Pandoc document to Html 5 structure.
106−writeHtmlString :: PandocMonad m => WriterOptions -> Pandoc -> m String
113+writeHtml5 :: PandocMonad m => WriterOptions -> Pandoc -> m Html
114+writeHtml5 = writeHtml' True
115+
116+-- | Convert Pandoc document to Html 4 string.
117+writeHtml4String :: PandocMonad m => WriterOptions -> Pandoc -> m String
107−writeHtmlString opts d = do
118+writeHtml4String = writeHtmlString' False
119+
120+-- | Convert Pandoc document to Html 4 structure.
121+writeHtml4 :: PandocMonad m => WriterOptions -> Pandoc -> m Html
122+writeHtml4 = writeHtml' False
123+
124+writeHtmlString' :: PandocMonad m => Bool -> WriterOptions -> Pandoc -> m String
125+writeHtmlString' html5 opts d = do
108− (body, context) <- evalStateT (pandocToHtml opts d) defaultWriterState
126+ (body, context) <- evalStateT (pandocToHtml opts d)
127+ defaultWriterState{ stHtml5 = html5 }
109 return $ case writerTemplate opts of
128 return $ case writerTemplate opts of
110 Nothing -> renderHtml body
129 Nothing -> renderHtml body
111 Just tpl -> renderTemplate' tpl $
130 Just tpl -> renderTemplate' tpl $
112 defField "body" (renderHtml body) context
131 defField "body" (renderHtml body) context
113
132
114−-- | Convert Pandoc document to Html structure.
115−writeHtml :: PandocMonad m => WriterOptions -> Pandoc -> m Html
133+writeHtml' :: PandocMonad m => Bool -> WriterOptions -> Pandoc -> m Html
116−writeHtml opts d = do
134+writeHtml' html5 opts d = do
117− (body, context) <- evalStateT (pandocToHtml opts d) defaultWriterState
135+ (body, context) <- evalStateT (pandocToHtml opts d)
136+ defaultWriterState{ stHtml5 = html5 }
118 return $ case writerTemplate opts of
137 return $ case writerTemplate opts of
119 Nothing -> body
138 Nothing -> body
120 Just tpl -> renderTemplate' tpl $
139 Just tpl -> renderTemplate' tpl $
@@ -144,8 +163,8 @@ pandocToHtml opts (Pandoc meta blocks) = do
144 blocks' <- liftM (mconcat . intersperse (nl opts)) $
163 blocks' <- liftM (mconcat . intersperse (nl opts)) $
145 mapM (elementToHtml slideLevel opts) sects
164 mapM (elementToHtml slideLevel opts) sects
146 st <- get
165 st <- get
147− let notes = reverse (stNotes st)
166+ notes <- footnoteSection opts (reverse (stNotes st))
148− let thebody = blocks' >> footnoteSection opts notes
167+ let thebody = blocks' >> notes
149 let math = case writerHTMLMathMethod opts of
168 let math = case writerHTMLMathMethod opts of
150 LaTeXMathML (Just url) ->
169 LaTeXMathML (Just url) ->
151 H.script ! A.src (toValue url)
170 H.script ! A.src (toValue url)
@@ -172,7 +191,7 @@ pandocToHtml opts (Pandoc meta blocks) = do
172 (H.link ! A.rel "stylesheet" ! A.href (toValue css)) <>
191 (H.link ! A.rel "stylesheet" ! A.href (toValue css)) <>
173 (H.script ! A.type_ "text/javascript" $ toHtml renderKaTeX)
192 (H.script ! A.type_ "text/javascript" $ toHtml renderKaTeX)
174 _ -> case lookup "mathml-script" (writerVariables opts) of
193 _ -> case lookup "mathml-script" (writerVariables opts) of
175− Just s | not (writerHtml5 opts) ->
194+ Just s | not (stHtml5 st) ->
176 H.script ! A.type_ "text/javascript"
195 H.script ! A.type_ "text/javascript"
177 $ preEscapedString
196 $ preEscapedString
178 ("/*<![CDATA[*/\n" ++ s ++ "/*]]>*/\n")
197 ("/*<![CDATA[*/\n" ++ s ++ "/*]]>*/\n")
@@ -199,7 +218,7 @@ pandocToHtml opts (Pandoc meta blocks) = do
199 defField "slideous-url" ("slideous" :: String) $
218 defField "slideous-url" ("slideous" :: String) $
200 defField "revealjs-url" ("reveal.js" :: String) $
219 defField "revealjs-url" ("reveal.js" :: String) $
201 defField "s5-url" ("s5/default" :: String) $
220 defField "s5-url" ("s5/default" :: String) $
202− defField "html5" (writerHtml5 opts) $
221+ defField "html5" (stHtml5 st) $
203 metadata
222 metadata
204 return (thebody, context)
223 return (thebody, context)
205
224
@@ -277,6 +296,7 @@ elementToHtml slideLevel opts (Sec level num (id',classes,keyvals) title' elemen
277 let slide = writerSlideVariant opts /= NoSlides && level <= slideLevel
296 let slide = writerSlideVariant opts /= NoSlides && level <= slideLevel
278 let num' = zipWith (+) num (writerNumberOffset opts ++ repeat 0)
297 let num' = zipWith (+) num (writerNumberOffset opts ++ repeat 0)
279 modify $ \st -> st{stSecNum = num'} -- update section number
298 modify $ \st -> st{stSecNum = num'} -- update section number
299+ html5 <- gets stHtml5
280 let titleSlide = slide && level < slideLevel
300 let titleSlide = slide && level < slideLevel
281 header' <- if title' == [Str "\0"] -- marker for hrule
301 header' <- if title' == [Str "\0"] -- marker for hrule
282 then return mempty
302 then return mempty
@@ -307,10 +327,10 @@ elementToHtml slideLevel opts (Sec level num (id',classes,keyvals) title' elemen
307 let inNl x = mconcat $ nl opts : intersperse (nl opts) x ++ [nl opts]
327 let inNl x = mconcat $ nl opts : intersperse (nl opts) x ++ [nl opts]
308 let classes' = ["titleslide" | titleSlide] ++ ["slide" | slide] ++
328 let classes' = ["titleslide" | titleSlide] ++ ["slide" | slide] ++
309 ["section" | (slide || writerSectionDivs opts) &&
329 ["section" | (slide || writerSectionDivs opts) &&
310− not (writerHtml5 opts) ] ++
330+ not html5 ] ++
311 ["level" ++ show level | slide || writerSectionDivs opts ]
331 ["level" ++ show level | slide || writerSectionDivs opts ]
312 ++ classes
332 ++ classes
313− let secttag = if writerHtml5 opts
333+ let secttag = if html5
314 then H5.section
334 then H5.section
315 else H.div
335 else H.div
316 let attr = (id',classes',keyvals)
336 let attr = (id',classes',keyvals)
@@ -327,19 +347,22 @@ elementToHtml slideLevel opts (Sec level num (id',classes,keyvals) title' elemen
327
347
328-- | Convert list of Note blocks to a footnote <div>.
348-- | Convert list of Note blocks to a footnote <div>.
329-- Assumes notes are sorted.
349-- Assumes notes are sorted.
350+footnoteSection :: PandocMonad m
330−footnoteSection :: WriterOptions -> [Html] -> Html
351+ => WriterOptions -> [Html] -> StateT WriterState m Html
331−footnoteSection opts notes =
352+footnoteSection opts notes = do
332− if null notes
353+ html5 <- gets stHtml5
333− then mempty
354+ let hrtag = if html5 then H5.hr else H.hr
334− else nl opts >> (container
335− $ nl opts >> hrtag >> nl opts >>
336− H.ol (mconcat notes >> nl opts) >> nl opts)
337− where container x = if writerHtml5 opts
355+ let container x = if html5
338− then H5.section ! A.class_ "footnotes" $ x
356+ then H5.section ! A.class_ "footnotes" $ x
339− else if writerSlideVariant opts /= NoSlides
357+ else if writerSlideVariant opts /= NoSlides
340− then H.div ! A.class_ "footnotes slide" $ x
358+ then H.div ! A.class_ "footnotes slide" $ x
341− else H.div ! A.class_ "footnotes" $ x
359+ else H.div ! A.class_ "footnotes" $ x
342− hrtag = if writerHtml5 opts then H5.hr else H.hr
360+ return $
361+ if null notes
362+ then mempty
363+ else nl opts >> (container
364+ $ nl opts >> hrtag >> nl opts >>
365+ H.ol (mconcat notes >> nl opts) >> nl opts)
343
366
344-- | Parse a mailto link; return Just (name, domain) or Nothing.
367-- | Parse a mailto link; return Just (name, domain) or Nothing.
345parseMailto :: String -> Maybe (String, String)
368parseMailto :: String -> Maybe (String, String)
@@ -448,13 +471,14 @@ blockToHtml opts (Plain lst) = inlineListToHtml opts lst
448-- title beginning with fig: indicates that the image is a figure
471-- title beginning with fig: indicates that the image is a figure
449blockToHtml opts (Para [Image attr txt (s,'f':'i':'g':':':tit)]) = do
472blockToHtml opts (Para [Image attr txt (s,'f':'i':'g':':':tit)]) = do
450 img <- inlineToHtml opts (Image attr txt (s,tit))
473 img <- inlineToHtml opts (Image attr txt (s,tit))
474+ html5 <- gets stHtml5
451− let tocapt = if writerHtml5 opts
475+ let tocapt = if html5
452 then H5.figcaption
476 then H5.figcaption
453 else H.p ! A.class_ "caption"
477 else H.p ! A.class_ "caption"
454 capt <- if null txt
478 capt <- if null txt
455 then return mempty
479 then return mempty
456 else tocapt `fmap` inlineListToHtml opts txt
480 else tocapt `fmap` inlineListToHtml opts txt
457− return $ if writerHtml5 opts
481+ return $ if html5
458 then H5.figure $ mconcat
482 then H5.figure $ mconcat
459 [nl opts, img, capt, nl opts]
483 [nl opts, img, capt, nl opts]
460 else H.div ! A.class_ "figure" $ mconcat
484 else H.div ! A.class_ "figure" $ mconcat
@@ -475,12 +499,13 @@ blockToHtml opts (LineBlock lns) =
475 htmlLines <- mconcat . intersperse lf <$> mapM (inlineListToHtml opts) lns
499 htmlLines <- mconcat . intersperse lf <$> mapM (inlineListToHtml opts) lns
476 return $ H.div ! A.style "white-space: pre-line;" $ htmlLines
500 return $ H.div ! A.style "white-space: pre-line;" $ htmlLines
477blockToHtml opts (Div attr@(ident, classes, kvs) bs) = do
501blockToHtml opts (Div attr@(ident, classes, kvs) bs) = do
502+ html5 <- gets stHtml5
478 let speakerNotes = "notes" `elem` classes
503 let speakerNotes = "notes" `elem` classes
479 -- we don't want incremental output inside speaker notes, see #1394
504 -- we don't want incremental output inside speaker notes, see #1394
480 let opts' = if speakerNotes then opts{ writerIncremental = False } else opts
505 let opts' = if speakerNotes then opts{ writerIncremental = False } else opts
481 contents <- blockListToHtml opts' bs
506 contents <- blockListToHtml opts' bs
482 let contents' = nl opts >> contents >> nl opts
507 let contents' = nl opts >> contents >> nl opts
483− let (divtag, classes') = if writerHtml5 opts && "section" `elem` classes
508+ let (divtag, classes') = if html5 && "section" `elem` classes
484 then (H5.section, filter (/= "section") classes)
509 then (H5.section, filter (/= "section") classes)
485 else (H.div, classes)
510 else (H.div, classes)
486 return $
511 return $
@@ -498,7 +523,9 @@ blockToHtml opts (RawBlock f str)
498 allowsMathEnvironments (writerHTMLMathMethod opts) &&
523 allowsMathEnvironments (writerHTMLMathMethod opts) &&
499 isMathEnvironment str = blockToHtml opts $ Plain [Math DisplayMath str]
524 isMathEnvironment str = blockToHtml opts $ Plain [Math DisplayMath str]
500 | otherwise = return mempty
525 | otherwise = return mempty
501−blockToHtml opts (HorizontalRule) = return $ if writerHtml5 opts then H5.hr else H.hr
526+blockToHtml _ (HorizontalRule) = do
527+ html5 <- gets stHtml5
528+ return $ if html5 then H5.hr else H.hr
502blockToHtml opts (CodeBlock (id',classes,keyvals) rawCode) = do
529blockToHtml opts (CodeBlock (id',classes,keyvals) rawCode) = do
503 let tolhs = isEnabled Ext_literate_haskell opts &&
530 let tolhs = isEnabled Ext_literate_haskell opts &&
504 any (\c -> map toLower c == "haskell") classes &&
531 any (\c -> map toLower c == "haskell") classes &&
@@ -564,6 +591,7 @@ blockToHtml opts (BulletList lst) = do
564 return $ unordList opts contents
591 return $ unordList opts contents
565blockToHtml opts (OrderedList (startnum, numstyle, _) lst) = do
592blockToHtml opts (OrderedList (startnum, numstyle, _) lst) = do
566 contents <- mapM (blockListToHtml opts) lst
593 contents <- mapM (blockListToHtml opts) lst
594+ html5 <- gets stHtml5
567 let numstyle' = case numstyle of
595 let numstyle' = case numstyle of
568 Example -> "decimal"
596 Example -> "decimal"
569 _ -> camelCaseToHyphenated $ show numstyle
597 _ -> camelCaseToHyphenated $ show numstyle
@@ -574,7 +602,7 @@ blockToHtml opts (OrderedList (startnum, numstyle, _) lst) = do
574 then [A.class_ "example"]
602 then [A.class_ "example"]
575 else []) ++
603 else []) ++
576 (if numstyle /= DefaultStyle
604 (if numstyle /= DefaultStyle
577− then if writerHtml5 opts
605+ then if html5
578 then [A.type_ $
606 then [A.type_ $
579 case numstyle of
607 case numstyle of
580 Decimal -> "1"
608 Decimal -> "1"
@@ -603,6 +631,7 @@ blockToHtml opts (Table capt aligns widths headers rows') = do
603 else do
631 else do
604 cs <- inlineListToHtml opts capt
632 cs <- inlineListToHtml opts capt
605 return $ H.caption cs >> nl opts
633 return $ H.caption cs >> nl opts
634+ html5 <- gets stHtml5
606 let percent w = show (truncate (100*w) :: Integer) ++ "%"
635 let percent w = show (truncate (100*w) :: Integer) ++ "%"
607 let coltags = if all (== 0.0) widths
636 let coltags = if all (== 0.0) widths
608 then mempty
637 then mempty
@@ -610,7 +639,7 @@ blockToHtml opts (Table capt aligns widths headers rows') = do
610 H.colgroup $ do
639 H.colgroup $ do
611 nl opts
640 nl opts
612 mapM_ (\w -> do
641 mapM_ (\w -> do
613− if writerHtml5 opts
642+ if html5
614 then H.col ! A.style (toValue $ "width: " ++
643 then H.col ! A.style (toValue $ "width: " ++
615 percent w)
644 percent w)
616 else H.col ! A.width (toValue $ percent w)
645 else H.col ! A.width (toValue $ percent w)
@@ -666,8 +695,9 @@ tableItemToHtml :: PandocMonad m
666 -> StateT WriterState m Html
695 -> StateT WriterState m Html
667tableItemToHtml opts tag' align' item = do
696tableItemToHtml opts tag' align' item = do
668 contents <- blockListToHtml opts item
697 contents <- blockListToHtml opts item
698+ html5 <- gets stHtml5
669 let alignStr = alignmentToString align'
699 let alignStr = alignmentToString align'
670− let attribs = if writerHtml5 opts
700+ let attribs = if html5
671 then A.style (toValue $ "text-align: " ++ alignStr ++ ";")
701 then A.style (toValue $ "text-align: " ++ alignStr ++ ";")
672 else A.align (toValue alignStr)
702 else A.align (toValue alignStr)
673 let tag'' = if null alignStr
703 let tag'' = if null alignStr
@@ -707,7 +737,8 @@ annotateMML e tex = math (unode "semantics" [cs, unode "annotation" (annotAttrs,
707-- | Convert Pandoc inline element to HTML.
737-- | Convert Pandoc inline element to HTML.
708inlineToHtml :: PandocMonad m
738inlineToHtml :: PandocMonad m
709 => WriterOptions -> Inline -> StateT WriterState m Html
739 => WriterOptions -> Inline -> StateT WriterState m Html
710−inlineToHtml opts inline =
740+inlineToHtml opts inline = do
741+ html5 <- gets stHtml5
711 case inline of
742 case inline of
712 (Str str) -> return $ strToHtml str
743 (Str str) -> return $ strToHtml str
713 (Space) -> return $ strToHtml " "
744 (Space) -> return $ strToHtml " "
@@ -715,7 +746,7 @@ inlineToHtml opts inline =
715 WrapNone -> preEscapedString " "
746 WrapNone -> preEscapedString " "
716 WrapAuto -> preEscapedString " "
747 WrapAuto -> preEscapedString " "
717 WrapPreserve -> preEscapedString "\n"
748 WrapPreserve -> preEscapedString "\n"
718− (LineBreak) -> return $ (if writerHtml5 opts then H5.br else H.br)
749+ (LineBreak) -> return $ (if html5 then H5.br else H.br)
719 <> strToHtml "\n"
750 <> strToHtml "\n"
720 (Span (id',classes,kvs) ils)
751 (Span (id',classes,kvs) ils)
721 -> inlineListToHtml opts ils >>=
752 -> inlineListToHtml opts ils >>=
@@ -784,12 +815,12 @@ inlineToHtml opts inline =
784 InlineMath -> H.span ! A.class_ mathClass $ m
815 InlineMath -> H.span ! A.class_ mathClass $ m
785 DisplayMath -> H.div ! A.class_ mathClass $ m
816 DisplayMath -> H.div ! A.class_ mathClass $ m
786 WebTeX url -> do
817 WebTeX url -> do
787− let imtag = if writerHtml5 opts then H5.img else H.img
818+ let imtag = if html5 then H5.img else H.img
788 let m = imtag ! A.style "vertical-align:middle"
819 let m = imtag ! A.style "vertical-align:middle"
789 ! A.src (toValue $ url ++ urlEncode str)
820 ! A.src (toValue $ url ++ urlEncode str)
790 ! A.alt (toValue str)
821 ! A.alt (toValue str)
791 ! A.title (toValue str)
822 ! A.title (toValue str)
792− let brtag = if writerHtml5 opts then H5.br else H.br
823+ let brtag = if html5 then H5.br else H.br
793 return $ case t of
824 return $ case t of
794 InlineMath -> m
825 InlineMath -> m
795 DisplayMath -> brtag >> m >> brtag
826 DisplayMath -> brtag >> m >> brtag
@@ -817,7 +848,7 @@ inlineToHtml opts inline =
817 PlainMath -> do
848 PlainMath -> do
818 x <- lift (texMathToInlines t str) >>= inlineListToHtml opts
849 x <- lift (texMathToInlines t str) >>= inlineListToHtml opts
819 let m = H.span ! A.class_ mathClass $ x
850 let m = H.span ! A.class_ mathClass $ x
820− let brtag = if writerHtml5 opts then H5.br else H.br
851+ let brtag = if html5 then H5.br else H.br
821 return $ case t of
852 return $ case t of
822 InlineMath -> m
853 InlineMath -> m
823 DisplayMath -> brtag >> m >> brtag
854 DisplayMath -> brtag >> m >> brtag
@@ -847,7 +878,7 @@ inlineToHtml opts inline =
847 [A.title $ toValue tit | not (null tit)] ++
878 [A.title $ toValue tit | not (null tit)] ++
848 [A.alt $ toValue alternate' | not (null txt)] ++
879 [A.alt $ toValue alternate' | not (null txt)] ++
849 imgAttrsToHtml opts attr
880 imgAttrsToHtml opts attr
850− let tag = if writerHtml5 opts then H5.img else H.img
881+ let tag = if html5 then H5.img else H.img
851 return $ foldl (!) tag attributes
882 return $ foldl (!) tag attributes
852 -- note: null title included, as in Markdown.pl
883 -- note: null title included, as in Markdown.pl
853 (Image attr _ (s,tit)) -> do
884 (Image attr _ (s,tit)) -> do
@@ -880,7 +911,7 @@ inlineToHtml opts inline =
880 (Cite cits il)-> do contents <- inlineListToHtml opts il
911 (Cite cits il)-> do contents <- inlineListToHtml opts il
881 let citationIds = unwords $ map citationId cits
912 let citationIds = unwords $ map citationId cits
882 let result = H.span ! A.class_ "citation" $ contents
913 let result = H.span ! A.class_ "citation" $ contents
883− return $ if writerHtml5 opts
914+ return $ if html5
884 then result ! customAttribute "data-cites" (toValue citationIds)
915 then result ! customAttribute "data-cites" (toValue citationIds)
885 else result
916 else result
886
917
src/Text/Pandoc/Writers/Markdown.hs+4−4
@@ -47,7 +47,7 @@ import Text.Pandoc.Pretty
47import Control.Monad.Reader
47import Control.Monad.Reader
48import Control.Monad.State
48import Control.Monad.State
49import Control.Monad.Except (throwError)
49import Control.Monad.Except (throwError)
50−import Text.Pandoc.Writers.HTML (writeHtmlString)
50+import Text.Pandoc.Writers.HTML (writeHtml5String)
51import Text.Pandoc.Writers.Math (texMathToInlines)
51import Text.Pandoc.Writers.Math (texMathToInlines)
52import Text.HTML.TagSoup (parseTags, isTagText, Tag(..))
52import Text.HTML.TagSoup (parseTags, isTagText, Tag(..))
53import Network.URI (isURI)
53import Network.URI (isURI)
@@ -536,7 +536,7 @@ blockToMarkdown' opts t@(Table caption aligns widths headers rows) = do
536 rawHeaders rawRows
536 rawHeaders rawRows
537 | isEnabled Ext_raw_html opts -> fmap (id,) $
537 | isEnabled Ext_raw_html opts -> fmap (id,) $
538 text <$>
538 text <$>
539− (writeHtmlString def $ Pandoc nullMeta [t])
539+ (writeHtml5String def $ Pandoc nullMeta [t])
540 | otherwise -> return $ (id, text "[TABLE]")
540 | otherwise -> return $ (id, text "[TABLE]")
541 return $ nst $ tbl $$ blankline $$ caption'' $$ blankline
541 return $ nst $ tbl $$ blankline $$ caption'' $$ blankline
542blockToMarkdown' opts (BulletList items) = do
542blockToMarkdown' opts (BulletList items) = do
@@ -1072,7 +1072,7 @@ inlineToMarkdown opts lnk@(Link attr txt (src, tit))
1072 | isEnabled Ext_raw_html opts &&
1072 | isEnabled Ext_raw_html opts &&
1073 not (isEnabled Ext_link_attributes opts) &&
1073 not (isEnabled Ext_link_attributes opts) &&
1074 attr /= nullAttr = -- use raw HTML
1074 attr /= nullAttr = -- use raw HTML
1075− (text . trim) <$> writeHtmlString def (Pandoc nullMeta [Plain [lnk]])
1075+ (text . trim) <$> writeHtml5String def (Pandoc nullMeta [Plain [lnk]])
1076 | otherwise = do
1076 | otherwise = do
1077 plain <- asks envPlain
1077 plain <- asks envPlain
1078 linktext <- inlineListToMarkdown opts txt
1078 linktext <- inlineListToMarkdown opts txt
@@ -1111,7 +1111,7 @@ inlineToMarkdown opts img@(Image attr alternate (source, tit))
1111 | isEnabled Ext_raw_html opts &&
1111 | isEnabled Ext_raw_html opts &&
1112 not (isEnabled Ext_link_attributes opts) &&
1112 not (isEnabled Ext_link_attributes opts) &&
1113 attr /= nullAttr = -- use raw HTML
1113 attr /= nullAttr = -- use raw HTML
1114− (text . trim) <$> writeHtmlString def (Pandoc nullMeta [Plain [img]])
1114+ (text . trim) <$> writeHtml5String def (Pandoc nullMeta [Plain [img]])
1115 | otherwise = do
1115 | otherwise = do
1116 plain <- asks envPlain
1116 plain <- asks envPlain
1117 let txt = if null alternate || alternate == [Str source]
1117 let txt = if null alternate || alternate == [Str source]
src/Text/Pandoc/Writers/OPML.hs+2−2
@@ -35,7 +35,7 @@ import Text.Pandoc.Writers.Shared
35import Text.Pandoc.Shared
35import Text.Pandoc.Shared
36import Text.Pandoc.Options
36import Text.Pandoc.Options
37import Text.Pandoc.Templates (renderTemplate')
37import Text.Pandoc.Templates (renderTemplate')
38−import Text.Pandoc.Writers.HTML (writeHtmlString)
38+import Text.Pandoc.Writers.HTML (writeHtml5String)
39import Text.Pandoc.Writers.Markdown (writeMarkdown)
39import Text.Pandoc.Writers.Markdown (writeMarkdown)
40import Text.Pandoc.Pretty
40import Text.Pandoc.Pretty
41import Text.Pandoc.Compat.Time
41import Text.Pandoc.Compat.Time
@@ -65,7 +65,7 @@ writeOPML opts (Pandoc meta blocks) = do
65
65
66writeHtmlInlines :: PandocMonad m => [Inline] -> m String
66writeHtmlInlines :: PandocMonad m => [Inline] -> m String
67writeHtmlInlines ils =
67writeHtmlInlines ils =
68− trim <$> (writeHtmlString def $ Pandoc nullMeta [Plain ils])
68+ trim <$> (writeHtml5String def $ Pandoc nullMeta [Plain ils])
69
69
70-- date format: RFC 822: Thu, 14 Jul 2005 23:41:05 GMT
70-- date format: RFC 822: Thu, 14 Jul 2005 23:41:05 GMT
71showDateTimeRFC822 :: UTCTime -> String
71showDateTimeRFC822 :: UTCTime -> String
tests/Tests/Old.hs+4−3
@@ -81,16 +81,17 @@ tests = [ testGroup "markdown"
81 ]
81 ]
82 ]
82 ]
83 , testGroup "html"
83 , testGroup "html"
84− [ testGroup "writer" (writerTests "html" ++ lhsWriterTests "html")
84+ [ testGroup "writer" (writerTests "html4" ++ writerTests "html5" ++
85+ lhsWriterTests "html")
85 , test "reader" ["-r", "html", "-w", "native", "-s"]
86 , test "reader" ["-r", "html", "-w", "native", "-s"]
86 "html-reader.html" "html-reader.native"
87 "html-reader.html" "html-reader.native"
87 ]
88 ]
88 , testGroup "s5"
89 , testGroup "s5"
89 [ s5WriterTest "basic" ["-s"] "s5"
90 [ s5WriterTest "basic" ["-s"] "s5"
90 , s5WriterTest "fancy" ["-s","-m","-i"] "s5"
91 , s5WriterTest "fancy" ["-s","-m","-i"] "s5"
91− , s5WriterTest "fragment" [] "html"
92+ , s5WriterTest "fragment" [] "html4"
92 , s5WriterTest "inserts" ["-s", "-H", "insert",
93 , s5WriterTest "inserts" ["-s", "-H", "insert",
93− "-B", "insert", "-A", "insert", "-c", "main.css"] "html"
94+ "-B", "insert", "-A", "insert", "-c", "main.css"] "html4"
94 ]
95 ]
95 , testGroup "textile"
96 , testGroup "textile"
96 [ testGroup "writer" $ writerTests "textile"
97 [ testGroup "writer" $ writerTests "textile"
tests/Tests/Writers/HTML.hs+1−1
@@ -8,7 +8,7 @@ import Tests.Helpers
8import Text.Pandoc.Arbitrary()
8import Text.Pandoc.Arbitrary()
9
9
10html :: (ToPandoc a) => a -> String
10html :: (ToPandoc a) => a -> String
11−html = purely (writeHtmlString def{ writerWrapText = WrapNone }) . toPandoc
11+html = purely (writeHtml4String def{ writerWrapText = WrapNone }) . toPandoc
12
12
13{-
13{-
14 "my test" =: X =?> Y
14 "my test" =: X =?> Y
tests/lhs-test.html+8−5
@@ -1,9 +1,9 @@
1−<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1+<!DOCTYPE html>
2−<html xmlns="http://www.w3.org/1999/xhtml">
2+<html>
3<head>
3<head>
4− <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4+ <meta charset="utf-8">
5− <meta http-equiv="Content-Style-Type" content="text/css" />
6− <meta name="generator" content="pandoc" />
5+ <meta name="generator" content="pandoc">
6+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
7 <title></title>
7 <title></title>
8 <style type="text/css">code{white-space: pre;}</style>
8 <style type="text/css">code{white-space: pre;}</style>
9 <style type="text/css">
9 <style type="text/css">
@@ -43,6 +43,9 @@ code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Ann
43code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
43code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
44code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
44code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
45 </style>
45 </style>
46+ <!--[if lt IE 9]>
47+ <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
48+ <![endif]-->
46</head>
49</head>
47<body>
50<body>
48<h1 id="lhs-test">lhs test</h1>
51<h1 id="lhs-test">lhs test</h1>
tests/lhs-test.html+lhs+8−5
@@ -1,9 +1,9 @@
1−<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1+<!DOCTYPE html>
2−<html xmlns="http://www.w3.org/1999/xhtml">
2+<html>
3<head>
3<head>
4− <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4+ <meta charset="utf-8">
5− <meta http-equiv="Content-Style-Type" content="text/css" />
6− <meta name="generator" content="pandoc" />
5+ <meta name="generator" content="pandoc">
6+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
7 <title></title>
7 <title></title>
8 <style type="text/css">code{white-space: pre;}</style>
8 <style type="text/css">code{white-space: pre;}</style>
9 <style type="text/css">
9 <style type="text/css">
@@ -43,6 +43,9 @@ code > span.an { color: #60a0b0; font-weight: bold; font-style: italic; } /* Ann
43code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
43code > span.cv { color: #60a0b0; font-weight: bold; font-style: italic; } /* CommentVar */
44code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
44code > span.in { color: #60a0b0; font-weight: bold; font-style: italic; } /* Information */
45 </style>
45 </style>
46+ <!--[if lt IE 9]>
47+ <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
48+ <![endif]-->
46</head>
49</head>
47<body>
50<body>
48<h1 id="lhs-test">lhs test</h1>
51<h1 id="lhs-test">lhs test</h1>
tests/tables.html → tests/tables.html4renamed

The content is the same.

tests/tables.html5new file+204
@@ -0,0 +1,204 @@
1+<p>Simple table with caption:</p>
2+<table>
3+<caption>Demonstration of simple table syntax.</caption>
4+<thead>
5+<tr class="header">
6+<th style="text-align: right;">Right</th>
7+<th style="text-align: left;">Left</th>
8+<th style="text-align: center;">Center</th>
9+<th>Default</th>
10+</tr>
11+</thead>
12+<tbody>
13+<tr class="odd">
14+<td style="text-align: right;">12</td>
15+<td style="text-align: left;">12</td>
16+<td style="text-align: center;">12</td>
17+<td>12</td>
18+</tr>
19+<tr class="even">
20+<td style="text-align: right;">123</td>
21+<td style="text-align: left;">123</td>
22+<td style="text-align: center;">123</td>
23+<td>123</td>
24+</tr>
25+<tr class="odd">
26+<td style="text-align: right;">1</td>
27+<td style="text-align: left;">1</td>
28+<td style="text-align: center;">1</td>
29+<td>1</td>
30+</tr>
31+</tbody>
32+</table>
33+<p>Simple table without caption:</p>
34+<table>
35+<thead>
36+<tr class="header">
37+<th style="text-align: right;">Right</th>
38+<th style="text-align: left;">Left</th>
39+<th style="text-align: center;">Center</th>
40+<th>Default</th>
41+</tr>
42+</thead>
43+<tbody>
44+<tr class="odd">
45+<td style="text-align: right;">12</td>
46+<td style="text-align: left;">12</td>
47+<td style="text-align: center;">12</td>
48+<td>12</td>
49+</tr>
50+<tr class="even">
51+<td style="text-align: right;">123</td>
52+<td style="text-align: left;">123</td>
53+<td style="text-align: center;">123</td>
54+<td>123</td>
55+</tr>
56+<tr class="odd">
57+<td style="text-align: right;">1</td>
58+<td style="text-align: left;">1</td>
59+<td style="text-align: center;">1</td>
60+<td>1</td>
61+</tr>
62+</tbody>
63+</table>
64+<p>Simple table indented two spaces:</p>
65+<table>
66+<caption>Demonstration of simple table syntax.</caption>
67+<thead>
68+<tr class="header">
69+<th style="text-align: right;">Right</th>
70+<th style="text-align: left;">Left</th>
71+<th style="text-align: center;">Center</th>
72+<th>Default</th>
73+</tr>
74+</thead>
75+<tbody>
76+<tr class="odd">
77+<td style="text-align: right;">12</td>
78+<td style="text-align: left;">12</td>
79+<td style="text-align: center;">12</td>
80+<td>12</td>
81+</tr>
82+<tr class="even">
83+<td style="text-align: right;">123</td>
84+<td style="text-align: left;">123</td>
85+<td style="text-align: center;">123</td>
86+<td>123</td>
87+</tr>
88+<tr class="odd">
89+<td style="text-align: right;">1</td>
90+<td style="text-align: left;">1</td>
91+<td style="text-align: center;">1</td>
92+<td>1</td>
93+</tr>
94+</tbody>
95+</table>
96+<p>Multiline table with caption:</p>
97+<table style="width:79%;">
98+<caption>Here’s the caption. It may span multiple lines.</caption>
99+<colgroup>
100+<col style="width: 15%" />
101+<col style="width: 13%" />
102+<col style="width: 16%" />
103+<col style="width: 33%" />
104+</colgroup>
105+<thead>
106+<tr class="header">
107+<th style="text-align: center;">Centered Header</th>
108+<th style="text-align: left;">Left Aligned</th>
109+<th style="text-align: right;">Right Aligned</th>
110+<th style="text-align: left;">Default aligned</th>
111+</tr>
112+</thead>
113+<tbody>
114+<tr class="odd">
115+<td style="text-align: center;">First</td>
116+<td style="text-align: left;">row</td>
117+<td style="text-align: right;">12.0</td>
118+<td style="text-align: left;">Example of a row that spans multiple lines.</td>
119+</tr>
120+<tr class="even">
121+<td style="text-align: center;">Second</td>
122+<td style="text-align: left;">row</td>
123+<td style="text-align: right;">5.0</td>
124+<td style="text-align: left;">Here’s another one. Note the blank line between rows.</td>
125+</tr>
126+</tbody>
127+</table>
128+<p>Multiline table without caption:</p>
129+<table style="width:79%;">
130+<colgroup>
131+<col style="width: 15%" />
132+<col style="width: 13%" />
133+<col style="width: 16%" />
134+<col style="width: 33%" />
135+</colgroup>
136+<thead>
137+<tr class="header">
138+<th style="text-align: center;">Centered Header</th>
139+<th style="text-align: left;">Left Aligned</th>
140+<th style="text-align: right;">Right Aligned</th>
141+<th style="text-align: left;">Default aligned</th>
142+</tr>
143+</thead>
144+<tbody>
145+<tr class="odd">
146+<td style="text-align: center;">First</td>
147+<td style="text-align: left;">row</td>
148+<td style="text-align: right;">12.0</td>
149+<td style="text-align: left;">Example of a row that spans multiple lines.</td>
150+</tr>
151+<tr class="even">
152+<td style="text-align: center;">Second</td>
153+<td style="text-align: left;">row</td>
154+<td style="text-align: right;">5.0</td>
155+<td style="text-align: left;">Here’s another one. Note the blank line between rows.</td>
156+</tr>
157+</tbody>
158+</table>
159+<p>Table without column headers:</p>
160+<table>
161+<tbody>
162+<tr class="odd">
163+<td style="text-align: right;">12</td>
164+<td style="text-align: left;">12</td>
165+<td style="text-align: center;">12</td>
166+<td style="text-align: right;">12</td>
167+</tr>
168+<tr class="even">
169+<td style="text-align: right;">123</td>
170+<td style="text-align: left;">123</td>
171+<td style="text-align: center;">123</td>
172+<td style="text-align: right;">123</td>
173+</tr>
174+<tr class="odd">
175+<td style="text-align: right;">1</td>
176+<td style="text-align: left;">1</td>
177+<td style="text-align: center;">1</td>
178+<td style="text-align: right;">1</td>
179+</tr>
180+</tbody>
181+</table>
182+<p>Multiline table without column headers:</p>
183+<table style="width:79%;">
184+<colgroup>
185+<col style="width: 15%" />
186+<col style="width: 13%" />
187+<col style="width: 16%" />
188+<col style="width: 33%" />
189+</colgroup>
190+<tbody>
191+<tr class="odd">
192+<td style="text-align: center;">First</td>
193+<td style="text-align: left;">row</td>
194+<td style="text-align: right;">12.0</td>
195+<td>Example of a row that spans multiple lines.</td>
196+</tr>
197+<tr class="even">
198+<td style="text-align: center;">Second</td>
199+<td style="text-align: left;">row</td>
200+<td style="text-align: right;">5.0</td>
201+<td>Here’s another one. Note the blank line between rows.</td>
202+</tr>
203+</tbody>
204+</table>
tests/writer.html → tests/writer.html4renamed

The content is the same.

tests/writer.html5new file+548
@@ -0,0 +1,548 @@
1+<!DOCTYPE html>
2+<html>
3+<head>
4+ <meta charset="utf-8">
5+ <meta name="generator" content="pandoc">
6+ <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
7+ <meta name="author" content="John MacFarlane">
8+ <meta name="author" content="Anonymous">
9+ <meta name="dcterms.date" content="2006-07-17">
10+ <title>Pandoc Test Suite</title>
11+ <style type="text/css">code{white-space: pre;}</style>
12+ <!--[if lt IE 9]>
13+ <script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
14+ <![endif]-->
15+</head>
16+<body>
17+<header>
18+<h1 class="title">Pandoc Test Suite</h1>
19+<p class="author">John MacFarlane</p>
20+<p class="author">Anonymous</p>
21+<p class="date">July 17, 2006</p>
22+</header>
23+<p>This is a set of tests for pandoc. Most of them are adapted from John Gruber’s markdown test suite.</p>
24+<hr />
25+<h1 id="headers">Headers</h1>
26+<h2 id="level-2-with-an-embedded-link">Level 2 with an <a href="/url">embedded link</a></h2>
27+<h3 id="level-3-with-emphasis">Level 3 with <em>emphasis</em></h3>
28+<h4 id="level-4">Level 4</h4>
29+<h5 id="level-5">Level 5</h5>
30+<h1 id="level-1">Level 1</h1>
31+<h2 id="level-2-with-emphasis">Level 2 with <em>emphasis</em></h2>
32+<h3 id="level-3">Level 3</h3>
33+<p>with no blank line</p>
34+<h2 id="level-2">Level 2</h2>
35+<p>with no blank line</p>
36+<hr />
37+<h1 id="paragraphs">Paragraphs</h1>
38+<p>Here’s a regular paragraph.</p>
39+<p>In Markdown 1.0.0 and earlier. Version 8. This line turns into a list item. Because a hard-wrapped line in the middle of a paragraph looked like a list item.</p>
40+<p>Here’s one with a bullet. * criminey.</p>
41+<p>There should be a hard line break<br />
42+here.</p>
43+<hr />
44+<h1 id="block-quotes">Block Quotes</h1>
45+<p>E-mail style:</p>
46+<blockquote>
47+<p>This is a block quote. It is pretty short.</p>
48+</blockquote>
49+<blockquote>
50+<p>Code in a block quote:</p>
51+<pre><code>sub status {
52+ print &quot;working&quot;;
53+}</code></pre>
54+<p>A list:</p>
55+<ol type="1">
56+<li>item one</li>
57+<li>item two</li>
58+</ol>
59+<p>Nested block quotes:</p>
60+<blockquote>
61+<p>nested</p>
62+</blockquote>
63+<blockquote>
64+<p>nested</p>
65+</blockquote>
66+</blockquote>
67+<p>This should not be a block quote: 2 &gt; 1.</p>
68+<p>And a following paragraph.</p>
69+<hr />
70+<h1 id="code-blocks">Code Blocks</h1>
71+<p>Code:</p>
72+<pre><code>---- (should be four hyphens)
73+
74+sub status {
75+ print &quot;working&quot;;
76+}
77+
78+this code block is indented by one tab</code></pre>
79+<p>And:</p>
80+<pre><code> this code block is indented by two tabs
81+
82+These should not be escaped: \$ \\ \&gt; \[ \{</code></pre>
83+<hr />
84+<h1 id="lists">Lists</h1>
85+<h2 id="unordered">Unordered</h2>
86+<p>Asterisks tight:</p>
87+<ul>
88+<li>asterisk 1</li>
89+<li>asterisk 2</li>
90+<li>asterisk 3</li>
91+</ul>
92+<p>Asterisks loose:</p>
93+<ul>
94+<li><p>asterisk 1</p></li>
95+<li><p>asterisk 2</p></li>
96+<li><p>asterisk 3</p></li>
97+</ul>
98+<p>Pluses tight:</p>
99+<ul>
100+<li>Plus 1</li>
101+<li>Plus 2</li>
102+<li>Plus 3</li>
103+</ul>
104+<p>Pluses loose:</p>
105+<ul>
106+<li><p>Plus 1</p></li>
107+<li><p>Plus 2</p></li>
108+<li><p>Plus 3</p></li>
109+</ul>
110+<p>Minuses tight:</p>
111+<ul>
112+<li>Minus 1</li>
113+<li>Minus 2</li>
114+<li>Minus 3</li>
115+</ul>
116+<p>Minuses loose:</p>
117+<ul>
118+<li><p>Minus 1</p></li>
119+<li><p>Minus 2</p></li>
120+<li><p>Minus 3</p></li>
121+</ul>
122+<h2 id="ordered">Ordered</h2>
123+<p>Tight:</p>
124+<ol type="1">
125+<li>First</li>
126+<li>Second</li>
127+<li>Third</li>
128+</ol>
129+<p>and:</p>
130+<ol type="1">
131+<li>One</li>
132+<li>Two</li>
133+<li>Three</li>
134+</ol>
135+<p>Loose using tabs:</p>
136+<ol type="1">
137+<li><p>First</p></li>
138+<li><p>Second</p></li>
139+<li><p>Third</p></li>
140+</ol>
141+<p>and using spaces:</p>
142+<ol type="1">
143+<li><p>One</p></li>
144+<li><p>Two</p></li>
145+<li><p>Three</p></li>
146+</ol>
147+<p>Multiple paragraphs:</p>
148+<ol type="1">
149+<li><p>Item 1, graf one.</p>
150+<p>Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.</p></li>
151+<li><p>Item 2.</p></li>
152+<li><p>Item 3.</p></li>
153+</ol>
154+<h2 id="nested">Nested</h2>
155+<ul>
156+<li>Tab
157+<ul>
158+<li>Tab
159+<ul>
160+<li>Tab</li>
161+</ul></li>
162+</ul></li>
163+</ul>
164+<p>Here’s another:</p>
165+<ol type="1">
166+<li>First</li>
167+<li>Second:
168+<ul>
169+<li>Fee</li>
170+<li>Fie</li>
171+<li>Foe</li>
172+</ul></li>
173+<li>Third</li>
174+</ol>
175+<p>Same thing but with paragraphs:</p>
176+<ol type="1">
177+<li><p>First</p></li>
178+<li><p>Second:</p>
179+<ul>
180+<li>Fee</li>
181+<li>Fie</li>
182+<li>Foe</li>
183+</ul></li>
184+<li><p>Third</p></li>
185+</ol>
186+<h2 id="tabs-and-spaces">Tabs and spaces</h2>
187+<ul>
188+<li><p>this is a list item indented with tabs</p></li>
189+<li><p>this is a list item indented with spaces</p>
190+<ul>
191+<li><p>this is an example list item indented with tabs</p></li>
192+<li><p>this is an example list item indented with spaces</p></li>
193+</ul></li>
194+</ul>
195+<h2 id="fancy-list-markers">Fancy list markers</h2>
196+<ol start="2" type="1">
197+<li>begins with 2</li>
198+<li><p>and now 3</p>
199+<p>with a continuation</p>
200+<ol start="4" type="i">
201+<li>sublist with roman numerals, starting with 4</li>
202+<li>more items
203+<ol type="A">
204+<li>a subsublist</li>
205+<li>a subsublist</li>
206+</ol></li>
207+</ol></li>
208+</ol>
209+<p>Nesting:</p>
210+<ol type="A">
211+<li>Upper Alpha
212+<ol type="I">
213+<li>Upper Roman.
214+<ol start="6" type="1">
215+<li>Decimal start with 6
216+<ol start="3" type="a">
217+<li>Lower alpha with paren</li>
218+</ol></li>
219+</ol></li>
220+</ol></li>
221+</ol>
222+<p>Autonumbering:</p>
223+<ol>
224+<li>Autonumber.</li>
225+<li>More.
226+<ol>
227+<li>Nested.</li>
228+</ol></li>
229+</ol>
230+<p>Should not be a list item:</p>
231+<p>M.A. 2007</p>
232+<p>B. Williams</p>
233+<hr />
234+<h1 id="definition-lists">Definition Lists</h1>
235+<p>Tight using spaces:</p>
236+<dl>
237+<dt>apple</dt>
238+<dd>red fruit
239+</dd>
240+<dt>orange</dt>
241+<dd>orange fruit
242+</dd>
243+<dt>banana</dt>
244+<dd>yellow fruit
245+</dd>
246+</dl>
247+<p>Tight using tabs:</p>
248+<dl>
249+<dt>apple</dt>
250+<dd>red fruit
251+</dd>
252+<dt>orange</dt>
253+<dd>orange fruit
254+</dd>
255+<dt>banana</dt>
256+<dd>yellow fruit
257+</dd>
258+</dl>
259+<p>Loose:</p>
260+<dl>
261+<dt>apple</dt>
262+<dd><p>red fruit</p>
263+</dd>
264+<dt>orange</dt>
265+<dd><p>orange fruit</p>
266+</dd>
267+<dt>banana</dt>
268+<dd><p>yellow fruit</p>
269+</dd>
270+</dl>
271+<p>Multiple blocks with italics:</p>
272+<dl>
273+<dt><em>apple</em></dt>
274+<dd><p>red fruit</p>
275+<p>contains seeds, crisp, pleasant to taste</p>
276+</dd>
277+<dt><em>orange</em></dt>
278+<dd><p>orange fruit</p>
279+<pre><code>{ orange code block }</code></pre>
280+<blockquote>
281+<p>orange block quote</p>
282+</blockquote>
283+</dd>
284+</dl>
285+<p>Multiple definitions, tight:</p>
286+<dl>
287+<dt>apple</dt>
288+<dd>red fruit
289+</dd>
290+<dd>computer
291+</dd>
292+<dt>orange</dt>
293+<dd>orange fruit
294+</dd>
295+<dd>bank
296+</dd>
297+</dl>
298+<p>Multiple definitions, loose:</p>
299+<dl>
300+<dt>apple</dt>
301+<dd><p>red fruit</p>
302+</dd>
303+<dd><p>computer</p>
304+</dd>
305+<dt>orange</dt>
306+<dd><p>orange fruit</p>
307+</dd>
308+<dd><p>bank</p>
309+</dd>
310+</dl>
311+<p>Blank line after term, indented marker, alternate markers:</p>
312+<dl>
313+<dt>apple</dt>
314+<dd><p>red fruit</p>
315+</dd>
316+<dd><p>computer</p>
317+</dd>
318+<dt>orange</dt>
319+<dd><p>orange fruit</p>
320+<ol type="1">
321+<li>sublist</li>
322+<li>sublist</li>
323+</ol>
324+</dd>
325+</dl>
326+<h1 id="html-blocks">HTML Blocks</h1>
327+<p>Simple block on one line:</p>
328+<div>
329+foo
330+</div>
331+<p>And nested without indentation:</p>
332+<div>
333+<div>
334+<div>
335+<p>foo</p>
336+</div>
337+</div>
338+<div>
339+bar
340+</div>
341+</div>
342+<p>Interpreted markdown in a table:</p>
343+<table>
344+<tr>
345+<td>
346+This is <em>emphasized</em>
347+</td>
348+<td>
349+And this is <strong>strong</strong>
350+</td>
351+</tr>
352+</table>
353+<script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
354+<p>Here’s a simple block:</p>
355+<div>
356+<p>foo</p>
357+</div>
358+<p>This should be a code block, though:</p>
359+<pre><code>&lt;div&gt;
360+ foo
361+&lt;/div&gt;</code></pre>
362+<p>As should this:</p>
363+<pre><code>&lt;div&gt;foo&lt;/div&gt;</code></pre>
364+<p>Now, nested:</p>
365+<div>
366+<div>
367+<div>
368+foo
369+</div>
370+</div>
371+</div>
372+<p>This should just be an HTML comment:</p>
373+<!-- Comment -->
374+<p>Multiline:</p>
375+<!--
376+Blah
377+Blah
378+-->
379+<!--
380+ This is another comment.
381+-->
382+<p>Code block:</p>
383+<pre><code>&lt;!-- Comment --&gt;</code></pre>
384+<p>Just plain comment, with trailing spaces on the line:</p>
385+<!-- foo -->
386+<p>Code:</p>
387+<pre><code>&lt;hr /&gt;</code></pre>
388+<p>Hr’s:</p>
389+<hr>
390+<hr />
391+<hr />
392+<hr>
393+<hr />
394+<hr />
395+<hr class="foo" id="bar" />
396+<hr class="foo" id="bar" />
397+<hr class="foo" id="bar">
398+<hr />
399+<h1 id="inline-markup">Inline Markup</h1>
400+<p>This is <em>emphasized</em>, and so <em>is this</em>.</p>
401+<p>This is <strong>strong</strong>, and so <strong>is this</strong>.</p>
402+<p>An <em><a href="/url">emphasized link</a></em>.</p>
403+<p><strong><em>This is strong and em.</em></strong></p>
404+<p>So is <strong><em>this</em></strong> word.</p>
405+<p><strong><em>This is strong and em.</em></strong></p>
406+<p>So is <strong><em>this</em></strong> word.</p>
407+<p>This is code: <code>&gt;</code>, <code>$</code>, <code>\</code>, <code>\$</code>, <code>&lt;html&gt;</code>.</p>
408+<p><del>This is <em>strikeout</em>.</del></p>
409+<p>Superscripts: a<sup>bc</sup>d a<sup><em>hello</em></sup> a<sup>hello there</sup>.</p>
410+<p>Subscripts: H<sub>2</sub>O, H<sub>23</sub>O, H<sub>many of them</sub>O.</p>
411+<p>These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.</p>
412+<hr />
413+<h1 id="smart-quotes-ellipses-dashes">Smart quotes, ellipses, dashes</h1>
414+<p>“Hello,” said the spider. “‘Shelob’ is my name.”</p>
415+<p>‘A’, ‘B’, and ‘C’ are letters.</p>
416+<p>‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’</p>
417+<p>‘He said, “I want to go.”’ Were you alive in the 70’s?</p>
418+<p>Here is some quoted ‘<code>code</code>’ and a “<a href="http://example.com/?foo=1&amp;bar=2">quoted link</a>”.</p>
419+<p>Some dashes: one—two — three—four — five.</p>
420+<p>Dashes between numbers: 5–7, 255–66, 1987–1999.</p>
421+<p>Ellipses…and…and….</p>
422+<hr />
423+<h1 id="latex">LaTeX</h1>
424+<ul>
425+<li></li>
426+<li><span class="math inline">2 + 2 = 4</span></li>
427+<li><span class="math inline"><em>x</em> ∈ <em>y</em></span></li>
428+<li><span class="math inline"><em>α</em> ∧ <em>ω</em></span></li>
429+<li><span class="math inline">223</span></li>
430+<li><span class="math inline"><em>p</em></span>-Tree</li>
431+<li>Here’s some display math: <br /><span class="math display">$$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$$</span><br /></li>
432+<li>Here’s one that has a line break in it: <span class="math inline"><em>α</em> + <em>ω</em> × <em>x</em><sup>2</sup></span>.</li>
433+</ul>
434+<p>These shouldn’t be math:</p>
435+<ul>
436+<li>To get the famous equation, write <code>$e = mc^2$</code>.</li>
437+<li>$22,000 is a <em>lot</em> of money. So is $34,000. (It worked if “lot” is emphasized.)</li>
438+<li>Shoes ($20) and socks ($5).</li>
439+<li>Escaped <code>$</code>: $73 <em>this should be emphasized</em> 23$.</li>
440+</ul>
441+<p>Here’s a LaTeX table:</p>
442+
443+<hr />
444+<h1 id="special-characters">Special Characters</h1>
445+<p>Here is some unicode:</p>
446+<ul>
447+<li>I hat: Î</li>
448+<li>o umlaut: ö</li>
449+<li>section: §</li>
450+<li>set membership: ∈</li>
451+<li>copyright: ©</li>
452+</ul>
453+<p>AT&amp;T has an ampersand in their name.</p>
454+<p>AT&amp;T is another way to write it.</p>
455+<p>This &amp; that.</p>
456+<p>4 &lt; 5.</p>
457+<p>6 &gt; 5.</p>
458+<p>Backslash: \</p>
459+<p>Backtick: `</p>
460+<p>Asterisk: *</p>
461+<p>Underscore: _</p>
462+<p>Left brace: {</p>
463+<p>Right brace: }</p>
464+<p>Left bracket: [</p>
465+<p>Right bracket: ]</p>
466+<p>Left paren: (</p>
467+<p>Right paren: )</p>
468+<p>Greater-than: &gt;</p>
469+<p>Hash: #</p>
470+<p>Period: .</p>
471+<p>Bang: !</p>
472+<p>Plus: +</p>
473+<p>Minus: -</p>
474+<hr />
475+<h1 id="links">Links</h1>
476+<h2 id="explicit">Explicit</h2>
477+<p>Just a <a href="/url/">URL</a>.</p>
478+<p><a href="/url/" title="title">URL and title</a>.</p>
479+<p><a href="/url/" title="title preceded by two spaces">URL and title</a>.</p>
480+<p><a href="/url/" title="title preceded by a tab">URL and title</a>.</p>
481+<p><a href="/url/" title="title with &quot;quotes&quot; in it">URL and title</a></p>
482+<p><a href="/url/" title="title with single quotes">URL and title</a></p>
483+<p><a href="/url/with_underscore">with_underscore</a></p>
484+<p><a href="mailto:nobody@nowhere.net">Email link</a></p>
485+<p><a href="">Empty</a>.</p>
486+<h2 id="reference">Reference</h2>
487+<p>Foo <a href="/url/">bar</a>.</p>
488+<p>Foo <a href="/url/">bar</a>.</p>
489+<p>Foo <a href="/url/">bar</a>.</p>
490+<p>With <a href="/url/">embedded [brackets]</a>.</p>
491+<p><a href="/url/">b</a> by itself should be a link.</p>
492+<p>Indented <a href="/url">once</a>.</p>
493+<p>Indented <a href="/url">twice</a>.</p>
494+<p>Indented <a href="/url">thrice</a>.</p>
495+<p>This should [not][] be a link.</p>
496+<pre><code>[not]: /url</code></pre>
497+<p>Foo <a href="/url/" title="Title with &quot;quotes&quot; inside">bar</a>.</p>
498+<p>Foo <a href="/url/" title="Title with &quot;quote&quot; inside">biz</a>.</p>
499+<h2 id="with-ampersands">With ampersands</h2>
500+<p>Here’s a <a href="http://example.com/?foo=1&amp;bar=2">link with an ampersand in the URL</a>.</p>
501+<p>Here’s a link with an amersand in the link text: <a href="http://att.com/" title="AT&amp;T">AT&amp;T</a>.</p>
502+<p>Here’s an <a href="/script?foo=1&amp;bar=2">inline link</a>.</p>
503+<p>Here’s an <a href="/script?foo=1&amp;bar=2">inline link in pointy braces</a>.</p>
504+<h2 id="autolinks">Autolinks</h2>
505+<p>With an ampersand: <a href="http://example.com/?foo=1&amp;bar=2" class="uri">http://example.com/?foo=1&amp;bar=2</a></p>
506+<ul>
507+<li>In a list?</li>
508+<li><a href="http://example.com/" class="uri">http://example.com/</a></li>
509+<li>It should.</li>
510+</ul>
511+<p>An e-mail address: <a href="mailto:nobody@nowhere.net">nobody@nowhere.net</a></p>
512+<blockquote>
513+<p>Blockquoted: <a href="http://example.com/" class="uri">http://example.com/</a></p>
514+</blockquote>
515+<p>Auto-links should not occur here: <code>&lt;http://example.com/&gt;</code></p>
516+<pre><code>or here: &lt;http://example.com/&gt;</code></pre>
517+<hr />
518+<h1 id="images">Images</h1>
519+<p>From “Voyage dans la Lune” by Georges Melies (1902):</p>
520+<figure>
521+<img src="lalune.jpg" title="Voyage dans la Lune" alt="lalune" /><figcaption>lalune</figcaption>
522+</figure>
523+<p>Here is a movie <img src="movie.jpg" alt="movie" /> icon.</p>
524+<hr />
525+<h1 id="footnotes">Footnotes</h1>
526+<p>Here is a footnote reference,<a href="#fn1" class="footnoteRef" id="fnref1"><sup>1</sup></a> and another.<a href="#fn2" class="footnoteRef" id="fnref2"><sup>2</sup></a> This should <em>not</em> be a footnote reference, because it contains a space.[^my note] Here is an inline note.<a href="#fn3" class="footnoteRef" id="fnref3"><sup>3</sup></a></p>
527+<blockquote>
528+<p>Notes can go in quotes.<a href="#fn4" class="footnoteRef" id="fnref4"><sup>4</sup></a></p>
529+</blockquote>
530+<ol type="1">
531+<li>And in list items.<a href="#fn5" class="footnoteRef" id="fnref5"><sup>5</sup></a></li>
532+</ol>
533+<p>This paragraph should not be part of the note, as it is not indented.</p>
534+<section class="footnotes">
535+<hr />
536+<ol>
537+<li id="fn1"><p>Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.<a href="#fnref1">↩</a></p></li>
538+<li id="fn2"><p>Here’s the long note. This one contains multiple blocks.</p>
539+<p>Subsequent blocks are indented to show that they belong to the footnote (as with list items).</p>
540+<pre><code> { &lt;code&gt; }</code></pre>
541+<p>If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.<a href="#fnref2">↩</a></p></li>
542+<li id="fn3"><p>This is <em>easier</em> to type. Inline notes may contain <a href="http://google.com">links</a> and <code>]</code> verbatim characters, as well as [bracketed text].<a href="#fnref3">↩</a></p></li>
543+<li id="fn4"><p>In quote.<a href="#fnref4">↩</a></p></li>
544+<li id="fn5"><p>In list.<a href="#fnref5">↩</a></p></li>
545+</ol>
546+</section>
547+</body>
548+</html>