git.iko.soy/typeable/pandoc
on master help sign in
HTML writer: wrap sections in divs. Resolves Issue #70.

+ hierarchicalize has been rationalized; it builds a hierarchical representation of the document from the headers, and simultaneously gives each section a unique identifier based on the heading title. + Identifiers are now attached to the divs rather than to the headers themselves. + Table of content backlinks go to the beginning of the table, rather than to the section reference that was clicked. This seems better. + Code for constructing identifiers has been moved to Text.Pandoc.Shared from the HTML writer, since it is now consumed only by hierarchicalize. + In --strict mode, pandoc just prints bare headings, as before (unless --toc has been specified). + In s5 output, it does not wrap sections in divs, as that seems to confuse the s5 javascript. + Test suite updated accordingly. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1562 788f1e2b-df1e-0410-8736-df70ead52e1b

commitdf5244fd486c20fa6125d371898c211906eed58b authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSat 25 Apr 2009, 00:29 (17 years ago) parent2ab7640
10 files changed+1196−1135
src/Text/Pandoc/Shared.hs+71−16 src/Text/Pandoc/Writers/Docbook.hs+1−1 src/Text/Pandoc/Writers/HTML.hs+40−104 src/Text/Pandoc/Writers/Markdown.hs+1−1 src/Text/Pandoc/Writers/RTF.hs+1−1 tests/s5.basic.html+7−7 tests/s5.fancy.html+7−7 tests/s5.fragment.html+42−38 tests/s5.inserts.html+42−38 tests/writer.html+984−922
src/Text/Pandoc/Shared.hs+71−16
@@ -1,4 +1,4 @@
1−{-# LANGUAGE CPP #-}
1+{-# LANGUAGE CPP, DeriveDataTypeable #-}
22{-
33Copyright (C) 2006-8 John MacFarlane <jgm@berkeley.edu>
44
@@ -112,13 +112,16 @@ import Text.ParserCombinators.Parsec
112112import Text.PrettyPrint.HughesPJ ( Doc, fsep, ($$), (<>), empty, isEmpty, text, nest )
113113import qualified Text.PrettyPrint.HughesPJ as PP
114114import Text.Pandoc.CharacterReferences ( characterReference )
115−import Data.Char ( toLower, toUpper, ord, isLower, isUpper )
115+import Data.Char ( toLower, toUpper, ord, isLower, isUpper, isAlpha,
116+ isPunctuation )
116117import Data.List ( find, isPrefixOf, intercalate )
117−import Control.Monad ( join )
118118import Network.URI ( parseURI, URI (..), isAllowedInURI )
119119import System.Directory
120120import Prelude hiding ( putStrLn, writeFile, readFile, getContents )
121121import System.IO.UTF8
122+import Data.Generics
123+import qualified Control.Monad.State as S
124+import Control.Monad (join)
122125
123126--
124127-- List processing
@@ -878,22 +881,74 @@ endsWithPlain blocks =
878881
879882-- | Data structure for defining hierarchical Pandoc documents
880883data Element = Blk Block
881− | Sec [Inline] [Element] deriving (Eq, Read, Show)
882−
883−-- | Returns @True@ on Header block with at least the specified level
884−headerAtLeast :: Int -> Block -> Bool
885−headerAtLeast level (Header x _) = x <= level
886−headerAtLeast _ _ = False
884+ | Sec Int String [Inline] [Element]
885+ -- lvl ident label contents
886+ deriving (Eq, Read, Show, Typeable, Data)
887+
888+-- | Convert Pandoc inline list to plain text identifier.
889+inlineListToIdentifier :: [Inline] -> String
890+inlineListToIdentifier = dropWhile (not . isAlpha) . inlineListToIdentifier'
891+
892+inlineListToIdentifier' :: [Inline] -> [Char]
893+inlineListToIdentifier' [] = ""
894+inlineListToIdentifier' (x:xs) =
895+ xAsText ++ inlineListToIdentifier' xs
896+ where xAsText = case x of
897+ Str s -> filter (\c -> c == '-' || not (isPunctuation c)) $
898+ intercalate "-" $ words $ map toLower s
899+ Emph lst -> inlineListToIdentifier' lst
900+ Strikeout lst -> inlineListToIdentifier' lst
901+ Superscript lst -> inlineListToIdentifier' lst
902+ SmallCaps lst -> inlineListToIdentifier' lst
903+ Subscript lst -> inlineListToIdentifier' lst
904+ Strong lst -> inlineListToIdentifier' lst
905+ Quoted _ lst -> inlineListToIdentifier' lst
906+ Cite _ lst -> inlineListToIdentifier' lst
907+ Code s -> s
908+ Space -> "-"
909+ EmDash -> "-"
910+ EnDash -> "-"
911+ Apostrophe -> ""
912+ Ellipses -> ""
913+ LineBreak -> "-"
914+ Math _ _ -> ""
915+ TeX _ -> ""
916+ HtmlInline _ -> ""
917+ Link lst _ -> inlineListToIdentifier' lst
918+ Image lst _ -> inlineListToIdentifier' lst
919+ Note _ -> ""
887920
888921-- | Convert list of Pandoc blocks into (hierarchical) list of Elements
889922hierarchicalize :: [Block] -> [Element]
890−hierarchicalize [] = []
891−hierarchicalize (block:rest) =
892− case block of
893− (Header level title) ->
894− let (thisSection, rest') = break (headerAtLeast level) rest
895− in (Sec title (hierarchicalize thisSection)):(hierarchicalize rest')
896− x -> (Blk x):(hierarchicalize rest)
923+hierarchicalize blocks = S.evalState (hierarchicalizeWithIds blocks) []
924+
925+hierarchicalizeWithIds :: [Block] -> S.State [String] [Element]
926+hierarchicalizeWithIds [] = return []
927+hierarchicalizeWithIds ((Header level title'):xs) = do
928+ usedIdents <- S.get
929+ let ident = uniqueIdent title' usedIdents
930+ S.modify (ident :)
931+ let (sectionContents, rest) = break (headerLtEq level) xs
932+ sectionContents' <- hierarchicalizeWithIds sectionContents
933+ rest' <- hierarchicalizeWithIds rest
934+ return $ Sec level ident title' sectionContents' : rest'
935+hierarchicalizeWithIds (x:rest) = do
936+ rest' <- hierarchicalizeWithIds rest
937+ return $ (Blk x) : rest'
938+
939+headerLtEq :: Int -> Block -> Bool
940+headerLtEq level (Header l _) = l <= level
941+headerLtEq _ _ = False
942+
943+uniqueIdent :: [Inline] -> [String] -> String
944+uniqueIdent title' usedIdents =
945+ let baseIdent = inlineListToIdentifier title'
946+ numIdent n = baseIdent ++ "-" ++ show n
947+ in if baseIdent `elem` usedIdents
948+ then case find (\x -> numIdent x `notElem` usedIdents) ([1..60000] :: [Int]) of
949+ Just x -> numIdent x
950+ Nothing -> baseIdent -- if we have more than 60,000, allow repeats
951+ else baseIdent
897952
898953-- | True if block is a Header block.
899954isHeaderBlock :: Block -> Bool
src/Text/Pandoc/Writers/Docbook.hs+1−1
@@ -80,7 +80,7 @@ writeDocbook opts (Pandoc (Meta title authors date) blocks) =
8080-- | Convert an Element to Docbook.
8181elementToDocbook :: WriterOptions -> Element -> Doc
8282elementToDocbook opts (Blk block) = blockToDocbook opts block
83−elementToDocbook opts (Sec title elements) =
83+elementToDocbook opts (Sec _ _ title elements) =
8484 -- Docbook doesn't allow sections with no content, so insert some if needed
8585 let elements' = if null elements
8686 then [Blk (Para [])]
src/Text/Pandoc/Writers/HTML.hs+40−104
@@ -36,22 +36,21 @@ import Text.Pandoc.Shared
3636import Text.Pandoc.Readers.TeXMath
3737import Text.Pandoc.Highlighting ( highlightHtml, defaultHighlightingCss )
3838import Numeric ( showHex )
39−import Data.Char ( ord, toLower, isAlpha )
39+import Data.Char ( ord, toLower )
4040import Data.List ( isPrefixOf, intercalate )
41+import Data.Maybe ( catMaybes )
4142import qualified Data.Set as S
4243import Control.Monad.State
4344import Text.XHtml.Transitional hiding ( stringToHtml )
4445
4546data WriterState = WriterState
4647 { stNotes :: [Html] -- ^ List of notes
47− , stIds :: [String] -- ^ List of header identifiers
4848 , stMath :: Bool -- ^ Math is used in document
4949 , stCSS :: S.Set String -- ^ CSS to include in header
5050 } deriving Show
5151
5252defaultWriterState :: WriterState
53−defaultWriterState = WriterState {stNotes= [], stIds = [],
54− stMath = False, stCSS = S.empty}
53+defaultWriterState = WriterState {stNotes= [], stMath = False, stCSS = S.empty}
5554
5655-- Helpers to render HTML with the appropriate function.
5756
@@ -107,15 +106,13 @@ writeHtml opts (Pandoc (Meta tit authors date) blocks) =
107106 not (writerS5 opts)
108107 then h1 ! [theclass "title"] $ topTitle
109108 else noHtml
110− headerBlocks = filter isHeaderBlock blocks
111− ids = uniqueIdentifiers $
112− map (\(Header _ lst) -> lst) headerBlocks
109+ sects = hierarchicalize blocks
113110 toc = if writerTableOfContents opts
114− then tableOfContents opts headerBlocks ids
111+ then evalState (tableOfContents opts sects) defaultWriterState
115112 else noHtml
116− (blocks', newstate) =
117− runState (blockListToHtml opts blocks)
118− (defaultWriterState {stIds = ids})
113+ (blocks', newstate) = runState
114+ (mapM (elementToHtml opts) sects >>= return . toHtmlFromList)
115+ defaultWriterState
119116 cssLines = stCSS newstate
120117 css = if S.null cssLines
121118 then noHtml
@@ -146,35 +143,36 @@ writeHtml opts (Pandoc (Meta tit authors date) blocks) =
146143 then head' +++ body thebody
147144 else thebody
148145
149−-- | Construct table of contents from list of header blocks and identifiers.
150−-- Assumes there are as many identifiers as header blocks.
151−tableOfContents :: WriterOptions -> [Block] -> [String] -> Html
152−tableOfContents _ [] _ = noHtml
153−tableOfContents opts headers ids =
146+-- | Construct table of contents from list of elements.
147+tableOfContents :: WriterOptions -> [Element] -> State WriterState Html
148+tableOfContents _ [] = return noHtml
149+tableOfContents opts sects = do
154150 let opts' = opts { writerIgnoreNotes = True }
155− contentsTree = hierarchicalize headers
156− contents = evalState (mapM (elementToListItem opts') contentsTree)
157− (defaultWriterState {stIds = ids})
158− in thediv ! [identifier "toc"] $ unordList contents
151+ contents <- mapM (elementToListItem opts') sects
152+ return $ thediv ! [identifier "TOC"] $ unordList $ catMaybes contents
159153
160154-- | Converts an Element to a list item for a table of contents,
161155-- retrieving the appropriate identifier from state.
162−elementToListItem :: WriterOptions -> Element -> State WriterState Html
163−elementToListItem _ (Blk _) = return noHtml
164−elementToListItem opts (Sec headerText subsecs) = do
165− st <- get
166− let ids = stIds st
167− let (id', rest) = if null ids
168− then ("", [])
169− else (head ids, tail ids)
170− put $ st {stIds = rest}
156+elementToListItem :: WriterOptions -> Element -> State WriterState (Maybe Html)
157+elementToListItem _ (Blk _) = return Nothing
158+elementToListItem opts (Sec _ id' headerText subsecs) = do
171159 txt <- inlineListToHtml opts headerText
172− subHeads <- mapM (elementToListItem opts) subsecs
160+ subHeads <- mapM (elementToListItem opts) subsecs >>= return . catMaybes
173161 let subList = if null subHeads
174162 then noHtml
175− else unordList subHeads
176− return $ (anchor ! [href ("#" ++ id'), identifier ("TOC-" ++ id')] $ txt) +++
177− subList
163+ else unordList subHeads
164+ return $ Just $ (anchor ! [href ("#" ++ id')] $ txt) +++ subList
165+
166+-- | Convert an Element to Html.
167+elementToHtml :: WriterOptions -> Element -> State WriterState Html
168+elementToHtml opts (Blk block) = blockToHtml opts block
169+elementToHtml opts (Sec level id' title' elements) = do
170+ innerContents <- mapM (elementToHtml opts) elements
171+ header' <- blockToHtml opts (Header level title')
172+ return $ if writerS5 opts || (writerStrictMarkdown opts && not (writerTableOfContents opts))
173+ -- S5 gets confused by the extra divs around sections
174+ then toHtmlFromList (header' : innerContents)
175+ else thediv ! [identifier id'] << (header' : innerContents)
178176
179177-- | Convert list of Note blocks to a footnote <div>.
180178-- Assumes notes are sorted.
@@ -236,15 +234,6 @@ obfuscateChar char =
236234obfuscateString :: String -> String
237235obfuscateString = concatMap obfuscateChar . decodeCharacterReferences
238236
239−-- | True if character is a punctuation character (unicode).
240−isPunctuation :: Char -> Bool
241−isPunctuation c =
242− let c' = ord c
243− in if c `elem` "!\"'()*,-./:;<>?[\\]`{|}~" || c' >= 0x2000 && c' <= 0x206F ||
244− c' >= 0xE000 && c' <= 0xE0FF
245− then True
246− else False
247−
248237-- | Add CSS for document header.
249238addToCSS :: String -> State WriterState ()
250239addToCSS item = do
@@ -252,50 +241,6 @@ addToCSS item = do
252241 let current = stCSS st
253242 put $ st {stCSS = S.insert item current}
254243
255−-- | Convert Pandoc inline list to plain text identifier.
256−inlineListToIdentifier :: [Inline] -> String
257−inlineListToIdentifier = dropWhile (not . isAlpha) . inlineListToIdentifier'
258−
259−inlineListToIdentifier' :: [Inline] -> [Char]
260−inlineListToIdentifier' [] = ""
261−inlineListToIdentifier' (x:xs) =
262− xAsText ++ inlineListToIdentifier' xs
263− where xAsText = case x of
264− Str s -> filter (\c -> c == '-' || not (isPunctuation c)) $
265− intercalate "-" $ words $ map toLower s
266− Emph lst -> inlineListToIdentifier' lst
267− Strikeout lst -> inlineListToIdentifier' lst
268− Superscript lst -> inlineListToIdentifier' lst
269− SmallCaps lst -> inlineListToIdentifier' lst
270− Subscript lst -> inlineListToIdentifier' lst
271− Strong lst -> inlineListToIdentifier' lst
272− Quoted _ lst -> inlineListToIdentifier' lst
273− Cite _ lst -> inlineListToIdentifier' lst
274− Code s -> s
275− Space -> "-"
276− EmDash -> "-"
277− EnDash -> "-"
278− Apostrophe -> ""
279− Ellipses -> ""
280− LineBreak -> "-"
281− Math _ _ -> ""
282− TeX _ -> ""
283− HtmlInline _ -> ""
284− Link lst _ -> inlineListToIdentifier' lst
285− Image lst _ -> inlineListToIdentifier' lst
286− Note _ -> ""
287−
288−-- | Return unique identifiers for list of inline lists.
289−uniqueIdentifiers :: [[Inline]] -> [String]
290−uniqueIdentifiers ls =
291− let addIdentifier (nonuniqueIds, uniqueIds) l =
292− let new = inlineListToIdentifier l
293− matches = length $ filter (== new) nonuniqueIds
294− new' = (if null new then "section" else new) ++
295− if matches > 0 then ("-" ++ show matches) else ""
296− in (new:nonuniqueIds, new':uniqueIds)
297− in reverse $ snd $ foldl addIdentifier ([],[]) ls
298−
299244-- | Convert Pandoc block element to HTML.
300245blockToHtml :: WriterOptions -> Block -> State WriterState Html
301246blockToHtml _ Null = return $ noHtml
@@ -335,26 +280,17 @@ blockToHtml opts (BlockQuote blocks) =
335280 else blockListToHtml opts blocks >>= (return . blockquote)
336281blockToHtml opts (Header level lst) = do
337282 contents <- inlineListToHtml opts lst
338− st <- get
339− let ids = stIds st
340− let (id', rest) = if null ids
341− then ("", [])
342− else (head ids, tail ids)
343− put $ st {stIds = rest}
344− let attribs = if writerStrictMarkdown opts && not (writerTableOfContents opts)
345− then []
346− else [identifier id']
347283 let contents' = if writerTableOfContents opts
348− then anchor ! [href ("#TOC-" ++ id')] $ contents
284+ then anchor ! [href "#TOC"] $ contents
349285 else contents
350286 return $ case level of
351− 1 -> h1 contents' ! attribs
352− 2 -> h2 contents' ! attribs
353− 3 -> h3 contents' ! attribs
354− 4 -> h4 contents' ! attribs
355− 5 -> h5 contents' ! attribs
356− 6 -> h6 contents' ! attribs
357− _ -> paragraph contents' ! attribs
287+ 1 -> h1 contents'
288+ 2 -> h2 contents'
289+ 3 -> h3 contents'
290+ 4 -> h4 contents'
291+ 5 -> h5 contents'
292+ 6 -> h6 contents'
293+ _ -> paragraph contents'
358294blockToHtml opts (BulletList lst) = do
359295 contents <- mapM (blockListToHtml opts) lst
360296 let attribs = if writerIncremental opts
@@ -492,7 +428,7 @@ inlineToHtml opts inline =
492428 return $ primHtml $ "<EQ>" ++ str ++ "</EQ>"
493429 PlainMath ->
494430 inlineListToHtml opts (readTeXMath str) >>=
495− return . (thespan ! [theclass "math"]))
431+ return . (thespan ! [theclass "math"]) )
496432 (TeX str) -> case writerHTMLMathMethod opts of
497433 LaTeXMathML _ -> do modify (\st -> st {stMath = True})
498434 return $ primHtml str
src/Text/Pandoc/Writers/Markdown.hs+1−1
@@ -138,7 +138,7 @@ tableOfContents opts headers =
138138-- | Converts an Element to a list item for a table of contents,
139139elementToListItem :: Element -> [Block]
140140elementToListItem (Blk _) = []
141−elementToListItem (Sec headerText subsecs) = [Plain headerText] ++
141+elementToListItem (Sec _ _ headerText subsecs) = [Plain headerText] ++
142142 if null subsecs
143143 then []
144144 else [BulletList $ map elementToListItem subsecs]
src/Text/Pandoc/Writers/RTF.hs+1−1
@@ -59,7 +59,7 @@ tableOfContents headers =
5959
6060elementToListItem :: Element -> [Block]
6161elementToListItem (Blk _) = []
62−elementToListItem (Sec sectext subsecs) = [Plain sectext] ++
62+elementToListItem (Sec _ _ sectext subsecs) = [Plain sectext] ++
6363 if null subsecs
6464 then []
6565 else [BulletList (map elementToListItem subsecs)]
tests/s5.basic.html+7−7
@@ -276,24 +276,24 @@ window.onload=startup;window.onresize=function(){setTimeout('fontScale()',50);}
276276<div id="currentSlide"></div>
277277<div id="header"></div>
278278<div id="footer">
279−<h1 id="july-15-2006"
279+<h1
280280 >July 15, 2006</h1
281− ><h2 id="my-s5-document"
281+ ><h2
282282 >My S5 Document</h2
283283 ></div>
284284</div>
285285<div class="presentation">
286286
287287<div class="slide">
288−<h1 id="my-s5-document-1"
288+<h1
289289 >My S5 Document</h1
290− ><h3 id="sam-smith-jen-jones"
290+ ><h3
291291 >Sam Smith, Jen Jones</h3
292− ><h4 id="july-15-2006-1"
292+ ><h4
293293 >July 15, 2006</h4
294294 ></div>
295295<div class="slide">
296−<h1 id="first-slide"
296+<h1
297297 >First slide</h1
298298 ><ul
299299 ><li
@@ -303,7 +303,7 @@ window.onload=startup;window.onresize=function(){setTimeout('fontScale()',50);}
303303 ></ul
304304 ></div>
305305<div class="slide">
306−<h1 id="math"
306+<h1
307307 >Math</h1
308308 ><ul
309309 ><li
tests/s5.fancy.html+7−7
@@ -484,24 +484,24 @@ window.onload=startup;window.onresize=function(){setTimeout('fontScale()',50);}
484484<div id="currentSlide"></div>
485485<div id="header"></div>
486486<div id="footer">
487−<h1 id="july-15-2006"
487+<h1
488488 >July 15, 2006</h1
489− ><h2 id="my-s5-document"
489+ ><h2
490490 >My S5 Document</h2
491491 ></div>
492492</div>
493493<div class="presentation">
494494
495495<div class="slide">
496−<h1 id="my-s5-document-1"
496+<h1
497497 >My S5 Document</h1
498− ><h3 id="sam-smith-jen-jones"
498+ ><h3
499499 >Sam Smith, Jen Jones</h3
500− ><h4 id="july-15-2006-1"
500+ ><h4
501501 >July 15, 2006</h4
502502 ></div>
503503<div class="slide">
504−<h1 id="first-slide"
504+<h1
505505 >First slide</h1
506506 ><ul class="incremental"
507507 ><li
@@ -511,7 +511,7 @@ window.onload=startup;window.onresize=function(){setTimeout('fontScale()',50);}
511511 ></ul
512512 ></div>
513513<div class="slide">
514−<h1 id="math"
514+<h1
515515 >Math</h1
516516 ><ul class="incremental"
517517 ><li
tests/s5.fragment.html+42−38
@@ -1,41 +1,45 @@
1−<h1 id="first-slide"
2−>First slide</h1
3−><ul
4−><li
5− >first bullet</li
1+<div id="first-slide"
2+><h1
3+ >First slide</h1
4+ ><ul
65 ><li
7− >second bullet</li
8− ></ul
9−><h1 id="math"
10−>Math</h1
11−><ul
12−><li
13− ><span class="math"
14− >\frac{<em
15− >d</em
16− >}{<em
17− >dx</em
18− >}<em
19− >f</em
20− >(<em
21− >x</em
22− >)=\lim<sub
23− ><em
24− >h</em
25− >&#8201;&#8594;&#8201;0</sub
6+ >first bullet</li
7+ ><li
8+ >second bullet</li
9+ ></ul
10+ ></div
11+><div id="math"
12+><h1
13+ >Math</h1
14+ ><ul
15+ ><li
16+ ><span class="math"
2617 >\frac{<em
27− >f</em
28− >(<em
29− >x</em
30− >+<em
31− >h</em
32− >)-<em
33− >f</em
34− >(<em
35− >x</em
36− >)}{<em
37− >h</em
38− >}</span
39− ></li
40− ></ul
18+ >d</em
19+ >}{<em
20+ >dx</em
21+ >}<em
22+ >f</em
23+ >(<em
24+ >x</em
25+ >)=\lim<sub
26+ ><em
27+ >h</em
28+ >&#8201;&#8594;&#8201;0</sub
29+ >\frac{<em
30+ >f</em
31+ >(<em
32+ >x</em
33+ >+<em
34+ >h</em
35+ >)-<em
36+ >f</em
37+ >(<em
38+ >x</em
39+ >)}{<em
40+ >h</em
41+ >}</span
42+ ></li
43+ ></ul
44+ ></div
4145>
tests/s5.inserts.html+42−38
@@ -15,46 +15,50 @@ STUFF INSERTED
1515 >STUFF INSERTED
1616<h1 class="title"
1717 >My S5 Document</h1
18− ><h1 id="first-slide"
19− >First slide</h1
20− ><ul
21− ><li
22− >first bullet</li
18+ ><div id="first-slide"
19+ ><h1
20+ >First slide</h1
21+ ><ul
2322 ><li
24− >second bullet</li
25− ></ul
26− ><h1 id="math"
27− >Math</h1
28− ><ul
29− ><li
30− ><span class="math"
31− >\frac{<em
32− >d</em
33− >}{<em
34− >dx</em
35− >}<em
36− >f</em
37− >(<em
38− >x</em
39− >)=\lim<sub
40− ><em
41− >h</em
42− >&#8201;&#8594;&#8201;0</sub
23+ >first bullet</li
24+ ><li
25+ >second bullet</li
26+ ></ul
27+ ></div
28+ ><div id="math"
29+ ><h1
30+ >Math</h1
31+ ><ul
32+ ><li
33+ ><span class="math"
4334 >\frac{<em
44− >f</em
45− >(<em
46− >x</em
47− >+<em
48− >h</em
49− >)-<em
50− >f</em
51− >(<em
52− >x</em
53− >)}{<em
54− >h</em
55− >}</span
56− ></li
57− ></ul
35+ >d</em
36+ >}{<em
37+ >dx</em
38+ >}<em
39+ >f</em
40+ >(<em
41+ >x</em
42+ >)=\lim<sub
43+ ><em
44+ >h</em
45+ >&#8201;&#8594;&#8201;0</sub
46+ >\frac{<em
47+ >f</em
48+ >(<em
49+ >x</em
50+ >+<em
51+ >h</em
52+ >)-<em
53+ >f</em
54+ >(<em
55+ >x</em
56+ >)}{<em
57+ >h</em
58+ >}</span
59+ ></li
60+ ></ul
61+ ></div
5862 >STUFF INSERTED
5963</body
6064 ></html
tests/writer.html+984−922
@@ -15,96 +15,119 @@
1515 ><p
1616 >This is a set of tests for pandoc. Most of them are adapted from John Gruber&rsquo;s markdown test suite.</p
1717 ><hr
18− /><h1 id="headers"
19− >Headers</h1
20− ><h2 id="level-2-with-an-embedded-link"
21− >Level 2 with an <a href="/url"
22− >embedded link</a
23− ></h2
24− ><h3 id="level-3-with-emphasis"
25− >Level 3 with <em
26− >emphasis</em
27− ></h3
28− ><h4 id="level-4"
29− >Level 4</h4
30− ><h5 id="level-5"
31− >Level 5</h5
32− ><h1 id="level-1"
33− >Level 1</h1
34− ><h2 id="level-2-with-emphasis"
35− >Level 2 with <em
36− >emphasis</em
37− ></h2
38− ><h3 id="level-3"
39− >Level 3</h3
40− ><p
41− >with no blank line</p
42− ><h2 id="level-2"
43− >Level 2</h2
44− ><p
45− >with no blank line</p
46− ><hr
47− /><h1 id="paragraphs"
48− >Paragraphs</h1
49− ><p
50− >Here&rsquo;s a regular paragraph.</p
51− ><p
52− >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
53− ><p
54− >Here&rsquo;s one with a bullet. * criminey.</p
55− ><p
56− >There should be a hard line break<br
57− />here.</p
58− ><hr
59− /><h1 id="block-quotes"
60− >Block Quotes</h1
61− ><p
62− >E-mail style:</p
63− ><blockquote
64− ><p
65− >This is a block quote. It is pretty short.</p
66− ></blockquote
67− ><blockquote
68− ><p
69− >Code in a block quote:</p
70− ><pre
71− ><code
72− >sub status {
73− print &quot;working&quot;;
74−}
75−</code
76− ></pre
18+ /><div id="headers"
19+ ><h1
20+ >Headers</h1
21+ ><div id="level-2-with-an-embedded-link"
22+ ><h2
23+ >Level 2 with an <a href="/url"
24+ >embedded link</a
25+ ></h2
26+ ><div id="level-3-with-emphasis"
27+ ><h3
28+ >Level 3 with <em
29+ >emphasis</em
30+ ></h3
31+ ><div id="level-4"
32+ ><h4
33+ >Level 4</h4
34+ ><div id="level-5"
35+ ><h5
36+ >Level 5</h5
37+ ></div
38+ ></div
39+ ></div
40+ ></div
41+ ></div
42+ ><div id="level-1"
43+ ><h1
44+ >Level 1</h1
45+ ><div id="level-2-with-emphasis"
46+ ><h2
47+ >Level 2 with <em
48+ >emphasis</em
49+ ></h2
50+ ><div id="level-3"
51+ ><h3
52+ >Level 3</h3
53+ ><p
54+ >with no blank line</p
55+ ></div
56+ ></div
57+ ><div id="level-2"
58+ ><h2
59+ >Level 2</h2
60+ ><p
61+ >with no blank line</p
62+ ><hr
63+ /></div
64+ ></div
65+ ><div id="paragraphs"
66+ ><h1
67+ >Paragraphs</h1
7768 ><p
78− >A list:</p
79− ><ol style="list-style-type: decimal;"
80− ><li
81− >item one</li
82− ><li
83− >item two</li
84− ></ol
69+ >Here&rsquo;s a regular paragraph.</p
70+ ><p
71+ >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
72+ ><p
73+ >Here&rsquo;s one with a bullet. * criminey.</p
74+ ><p
75+ >There should be a hard line break<br
76+ />here.</p
77+ ><hr
78+ /></div
79+ ><div id="block-quotes"
80+ ><h1
81+ >Block Quotes</h1
8582 ><p
86− >Nested block quotes:</p
83+ >E-mail style:</p
8784 ><blockquote
8885 ><p
89− >nested</p
86+ >This is a block quote. It is pretty short.</p
9087 ></blockquote
9188 ><blockquote
9289 ><p
93− >nested</p
90+ >Code in a block quote:</p
91+ ><pre
92+ ><code
93+ >sub status {
94+ print &quot;working&quot;;
95+}
96+</code
97+ ></pre
98+ ><p
99+ >A list:</p
100+ ><ol style="list-style-type: decimal;"
101+ ><li
102+ >item one</li
103+ ><li
104+ >item two</li
105+ ></ol
106+ ><p
107+ >Nested block quotes:</p
108+ ><blockquote
109+ ><p
110+ >nested</p
111+ ></blockquote
112+ ><blockquote
113+ ><p
114+ >nested</p
115+ ></blockquote
94116 ></blockquote
95− ></blockquote
96− ><p
97− >This should not be a block quote: 2 &gt; 1.</p
98− ><p
99− >And a following paragraph.</p
100− ><hr
101− /><h1 id="code-blocks"
102− >Code Blocks</h1
103− ><p
104− >Code:</p
105− ><pre
106− ><code
107− >---- (should be four hyphens)
117+ ><p
118+ >This should not be a block quote: 2 &gt; 1.</p
119+ ><p
120+ >And a following paragraph.</p
121+ ><hr
122+ /></div
123+ ><div id="code-blocks"
124+ ><h1
125+ >Code Blocks</h1
126+ ><p
127+ >Code:</p
128+ ><pre
129+ ><code
130+ >---- (should be four hyphens)
108131
109132sub status {
110133 print &quot;working&quot;;
@@ -112,458 +135,474 @@ sub status {
112135
113136this code block is indented by one tab
114137</code
115− ></pre
116− ><p
117− >And:</p
118− ><pre
119− ><code
120− > this code block is indented by two tabs
138+ ></pre
139+ ><p
140+ >And:</p
141+ ><pre
142+ ><code
143+ > this code block is indented by two tabs
121144
122145These should not be escaped: \$ \\ \&gt; \[ \{
123146</code
124− ></pre
125− ><hr
126− /><h1 id="lists"
127− >Lists</h1
128− ><h2 id="unordered"
129− >Unordered</h2
130− ><p
131− >Asterisks tight:</p
132− ><ul
133− ><li
134− >asterisk 1</li
135− ><li
136− >asterisk 2</li
137− ><li
138− >asterisk 3</li
139− ></ul
140− ><p
141− >Asterisks loose:</p
142− ><ul
143− ><li
144− ><p
145− >asterisk 1</p
146− ></li
147− ><li
148− ><p
149− >asterisk 2</p
150− ></li
151− ><li
152− ><p
153− >asterisk 3</p
154− ></li
155− ></ul
156− ><p
157− >Pluses tight:</p
158− ><ul
159− ><li
160− >Plus 1</li
161− ><li
162− >Plus 2</li
163− ><li
164− >Plus 3</li
165− ></ul
166− ><p
167− >Pluses loose:</p
168− ><ul
169− ><li
170− ><p
171− >Plus 1</p
172− ></li
173− ><li
174− ><p
175− >Plus 2</p
176− ></li
177− ><li
178− ><p
179− >Plus 3</p
180− ></li
181− ></ul
182− ><p
183− >Minuses tight:</p
184− ><ul
185− ><li
186− >Minus 1</li
187− ><li
188− >Minus 2</li
189− ><li
190− >Minus 3</li
191− ></ul
192− ><p
193− >Minuses loose:</p
194− ><ul
195− ><li
196− ><p
197− >Minus 1</p
198− ></li
199− ><li
200− ><p
201− >Minus 2</p
202− ></li
203− ><li
204− ><p
205− >Minus 3</p
206− ></li
207− ></ul
208− ><h2 id="ordered"
209− >Ordered</h2
210− ><p
211− >Tight:</p
212− ><ol style="list-style-type: decimal;"
213− ><li
214− >First</li
215− ><li
216− >Second</li
217− ><li
218− >Third</li
219− ></ol
220− ><p
221− >and:</p
222− ><ol style="list-style-type: decimal;"
223− ><li
224− >One</li
225− ><li
226− >Two</li
227− ><li
228− >Three</li
229− ></ol
230− ><p
231− >Loose using tabs:</p
232− ><ol style="list-style-type: decimal;"
233− ><li
234− ><p
235− >First</p
236− ></li
237− ><li
238− ><p
239− >Second</p
240− ></li
241− ><li
242− ><p
243− >Third</p
244− ></li
245− ></ol
246− ><p
247− >and using spaces:</p
248− ><ol style="list-style-type: decimal;"
249− ><li
250− ><p
251− >One</p
252− ></li
253− ><li
254− ><p
255− >Two</p
256− ></li
257− ><li
258− ><p
259− >Three</p
260− ></li
261− ></ol
262− ><p
263− >Multiple paragraphs:</p
264− ><ol style="list-style-type: decimal;"
265− ><li
266− ><p
267− >Item 1, graf one.</p
147+ ></pre
148+ ><hr
149+ /></div
150+ ><div id="lists"
151+ ><h1
152+ >Lists</h1
153+ ><div id="unordered"
154+ ><h2
155+ >Unordered</h2
268156 ><p
269− >Item 1. graf two. The quick brown fox jumped over the lazy dog&rsquo;s back.</p
270− ></li
271− ><li
272− ><p
273− >Item 2.</p
274− ></li
275− ><li
276− ><p
277− >Item 3.</p
278− ></li
279− ></ol
280− ><h2 id="nested"
281− >Nested</h2
282− ><ul
283− ><li
284− >Tab<ul
157+ >Asterisks tight:</p
158+ ><ul
285159 ><li
286− >Tab<ul
287− ><li
288− >Tab</li
289− ></ul
160+ >asterisk 1</li
161+ ><li
162+ >asterisk 2</li
163+ ><li
164+ >asterisk 3</li
165+ ></ul
166+ ><p
167+ >Asterisks loose:</p
168+ ><ul
169+ ><li
170+ ><p
171+ >asterisk 1</p
172+ ></li
173+ ><li
174+ ><p
175+ >asterisk 2</p
176+ ></li
177+ ><li
178+ ><p
179+ >asterisk 3</p
290180 ></li
291181 ></ul
292− ></li
293− ></ul
294− ><p
295− >Here&rsquo;s another:</p
296− ><ol style="list-style-type: decimal;"
297− ><li
298− >First</li
299− ><li
300− >Second:<ul
182+ ><p
183+ >Pluses tight:</p
184+ ><ul
301185 ><li
302− >Fee</li
186+ >Plus 1</li
303187 ><li
304− >Fie</li
188+ >Plus 2</li
305189 ><li
306− >Foe</li
190+ >Plus 3</li
307191 ></ul
308− ></li
309− ><li
310− >Third</li
311− ></ol
312− ><p
313− >Same thing but with paragraphs:</p
314− ><ol style="list-style-type: decimal;"
315− ><li
316− ><p
317− >First</p
318− ></li
319− ><li
320− ><p
321− >Second:</p
192+ ><p
193+ >Pluses loose:</p
322194 ><ul
323195 ><li
324− >Fee</li
196+ ><p
197+ >Plus 1</p
198+ ></li
325199 ><li
326− >Fie</li
200+ ><p
201+ >Plus 2</p
202+ ></li
327203 ><li
328− >Foe</li
204+ ><p
205+ >Plus 3</p
206+ ></li
329207 ></ul
330− ></li
331− ><li
332− ><p
333− >Third</p
334− ></li
335− ></ol
336− ><h2 id="tabs-and-spaces"
337− >Tabs and spaces</h2
338− ><ul
339− ><li
340− ><p
341− >this is a list item indented with tabs</p
342− ></li
343− ><li
344− ><p
345− >this is a list item indented with spaces</p
208+ ><p
209+ >Minuses tight:</p
210+ ><ul
211+ ><li
212+ >Minus 1</li
213+ ><li
214+ >Minus 2</li
215+ ><li
216+ >Minus 3</li
217+ ></ul
218+ ><p
219+ >Minuses loose:</p
346220 ><ul
347221 ><li
348222 ><p
349− >this is an example list item indented with tabs</p
223+ >Minus 1</p
224+ ></li
225+ ><li
226+ ><p
227+ >Minus 2</p
350228 ></li
351229 ><li
352230 ><p
353− >this is an example list item indented with spaces</p
231+ >Minus 3</p
354232 ></li
355233 ></ul
356− ></li
357− ></ul
358− ><h2 id="fancy-list-markers"
359− >Fancy list markers</h2
360− ><ol start="2" style="list-style-type: decimal;"
361− ><li
362− >begins with 2</li
363− ><li
364− ><p
365− >and now 3</p
234+ ></div
235+ ><div id="ordered"
236+ ><h2
237+ >Ordered</h2
366238 ><p
367− >with a continuation</p
368− ><ol start="4" style="list-style-type: lower-roman;"
239+ >Tight:</p
240+ ><ol style="list-style-type: decimal;"
369241 ><li
370− >sublist with roman numerals, starting with 4</li
242+ >First</li
371243 ><li
372− >more items<ol style="list-style-type: upper-alpha;"
373− ><li
374− >a subsublist</li
375− ><li
376− >a subsublist</li
377− ></ol
244+ >Second</li
245+ ><li
246+ >Third</li
247+ ></ol
248+ ><p
249+ >and:</p
250+ ><ol style="list-style-type: decimal;"
251+ ><li
252+ >One</li
253+ ><li
254+ >Two</li
255+ ><li
256+ >Three</li
257+ ></ol
258+ ><p
259+ >Loose using tabs:</p
260+ ><ol style="list-style-type: decimal;"
261+ ><li
262+ ><p
263+ >First</p
264+ ></li
265+ ><li
266+ ><p
267+ >Second</p
268+ ></li
269+ ><li
270+ ><p
271+ >Third</p
378272 ></li
379273 ></ol
380− ></li
381− ></ol
382− ><p
383− >Nesting:</p
384− ><ol style="list-style-type: upper-alpha;"
385− ><li
386− >Upper Alpha<ol style="list-style-type: upper-roman;"
274+ ><p
275+ >and using spaces:</p
276+ ><ol style="list-style-type: decimal;"
277+ ><li
278+ ><p
279+ >One</p
280+ ></li
281+ ><li
282+ ><p
283+ >Two</p
284+ ></li
285+ ><li
286+ ><p
287+ >Three</p
288+ ></li
289+ ></ol
290+ ><p
291+ >Multiple paragraphs:</p
292+ ><ol style="list-style-type: decimal;"
293+ ><li
294+ ><p
295+ >Item 1, graf one.</p
296+ ><p
297+ >Item 1. graf two. The quick brown fox jumped over the lazy dog&rsquo;s back.</p
298+ ></li
299+ ><li
300+ ><p
301+ >Item 2.</p
302+ ></li
303+ ><li
304+ ><p
305+ >Item 3.</p
306+ ></li
307+ ></ol
308+ ></div
309+ ><div id="nested"
310+ ><h2
311+ >Nested</h2
312+ ><ul
387313 ><li
388− >Upper Roman.<ol start="6" style="list-style-type: decimal;"
314+ >Tab<ul
389315 ><li
390− >Decimal start with 6<ol start="3" style="list-style-type: lower-alpha;"
316+ >Tab<ul
391317 ><li
392− >Lower alpha with paren</li
393− ></ol
318+ >Tab</li
319+ ></ul
394320 ></li
395− ></ol
321+ ></ul
396322 ></li
397− ></ol
398− ></li
399− ></ol
400− ><p
401− >Autonumbering:</p
402− ><ol
403− ><li
404− >Autonumber.</li
405− ><li
406− >More.<ol
323+ ></ul
324+ ><p
325+ >Here&rsquo;s another:</p
326+ ><ol style="list-style-type: decimal;"
407327 ><li
408− >Nested.</li
328+ >First</li
329+ ><li
330+ >Second:<ul
331+ ><li
332+ >Fee</li
333+ ><li
334+ >Fie</li
335+ ><li
336+ >Foe</li
337+ ></ul
338+ ></li
339+ ><li
340+ >Third</li
409341 ></ol
410− ></li
411− ></ol
412− ><p
413− >Should not be a list item:</p
414− ><p
415− >M.A.&nbsp;2007</p
416− ><p
417− >B. Williams</p
418− ><hr
419− /><h1 id="definition-lists"
420− >Definition Lists</h1
421− ><p
422− >Tight using spaces:</p
423− ><dl
424− ><dt
425− >apple</dt
426− ><dd
427− >red fruit</dd
428− ><dt
429− >orange</dt
430− ><dd
431− >orange fruit</dd
432− ><dt
433− >banana</dt
434− ><dd
435− >yellow fruit</dd
436− ></dl
437− ><p
438− >Tight using tabs:</p
439− ><dl
440− ><dt
441− >apple</dt
442− ><dd
443− >red fruit</dd
444− ><dt
445− >orange</dt
446− ><dd
447− >orange fruit</dd
448− ><dt
449− >banana</dt
450− ><dd
451− >yellow fruit</dd
452− ></dl
453− ><p
454− >Loose:</p
455− ><dl
456− ><dt
457− >apple</dt
458− ><dd
459− ><p
460− >red fruit</p
461− ></dd
342+ ><p
343+ >Same thing but with paragraphs:</p
344+ ><ol style="list-style-type: decimal;"
345+ ><li
346+ ><p
347+ >First</p
348+ ></li
349+ ><li
350+ ><p
351+ >Second:</p
352+ ><ul
353+ ><li
354+ >Fee</li
355+ ><li
356+ >Fie</li
357+ ><li
358+ >Foe</li
359+ ></ul
360+ ></li
361+ ><li
362+ ><p
363+ >Third</p
364+ ></li
365+ ></ol
366+ ></div
367+ ><div id="tabs-and-spaces"
368+ ><h2
369+ >Tabs and spaces</h2
370+ ><ul
371+ ><li
372+ ><p
373+ >this is a list item indented with tabs</p
374+ ></li
375+ ><li
376+ ><p
377+ >this is a list item indented with spaces</p
378+ ><ul
379+ ><li
380+ ><p
381+ >this is an example list item indented with tabs</p
382+ ></li
383+ ><li
384+ ><p
385+ >this is an example list item indented with spaces</p
386+ ></li
387+ ></ul
388+ ></li
389+ ></ul
390+ ></div
391+ ><div id="fancy-list-markers"
392+ ><h2
393+ >Fancy list markers</h2
394+ ><ol start="2" style="list-style-type: decimal;"
395+ ><li
396+ >begins with 2</li
397+ ><li
398+ ><p
399+ >and now 3</p
400+ ><p
401+ >with a continuation</p
402+ ><ol start="4" style="list-style-type: lower-roman;"
403+ ><li
404+ >sublist with roman numerals, starting with 4</li
405+ ><li
406+ >more items<ol style="list-style-type: upper-alpha;"
407+ ><li
408+ >a subsublist</li
409+ ><li
410+ >a subsublist</li
411+ ></ol
412+ ></li
413+ ></ol
414+ ></li
415+ ></ol
416+ ><p
417+ >Nesting:</p
418+ ><ol style="list-style-type: upper-alpha;"
419+ ><li
420+ >Upper Alpha<ol style="list-style-type: upper-roman;"
421+ ><li
422+ >Upper Roman.<ol start="6" style="list-style-type: decimal;"
423+ ><li
424+ >Decimal start with 6<ol start="3" style="list-style-type: lower-alpha;"
425+ ><li
426+ >Lower alpha with paren</li
427+ ></ol
428+ ></li
429+ ></ol
430+ ></li
431+ ></ol
432+ ></li
433+ ></ol
434+ ><p
435+ >Autonumbering:</p
436+ ><ol
437+ ><li
438+ >Autonumber.</li
439+ ><li
440+ >More.<ol
441+ ><li
442+ >Nested.</li
443+ ></ol
444+ ></li
445+ ></ol
446+ ><p
447+ >Should not be a list item:</p
448+ ><p
449+ >M.A.&nbsp;2007</p
450+ ><p
451+ >B. Williams</p
452+ ><hr
453+ /></div
454+ ></div
455+ ><div id="definition-lists"
456+ ><h1
457+ >Definition Lists</h1
458+ ><p
459+ >Tight using spaces:</p
460+ ><dl
462461 ><dt
463− >orange</dt
464− ><dd
462+ >apple</dt
463+ ><dd
464+ >red fruit</dd
465+ ><dt
466+ >orange</dt
467+ ><dd
468+ >orange fruit</dd
469+ ><dt
470+ >banana</dt
471+ ><dd
472+ >yellow fruit</dd
473+ ></dl
465474 ><p
466− >orange fruit</p
467− ></dd
475+ >Tight using tabs:</p
476+ ><dl
468477 ><dt
469− >banana</dt
470− ><dd
478+ >apple</dt
479+ ><dd
480+ >red fruit</dd
481+ ><dt
482+ >orange</dt
483+ ><dd
484+ >orange fruit</dd
485+ ><dt
486+ >banana</dt
487+ ><dd
488+ >yellow fruit</dd
489+ ></dl
471490 ><p
472− >yellow fruit</p
473− ></dd
474− ></dl
475− ><p
476− >Multiple blocks with italics:</p
477− ><dl
478− ><dt
479− ><em
480− >apple</em
481− ></dt
482− ><dd
483− ><p
484− >red fruit</p
485− ><p
486− >contains seeds, crisp, pleasant to taste</p
487− ></dd
491+ >Loose:</p
492+ ><dl
488493 ><dt
489− ><em
490− >orange</em
491− ></dt
492− ><dd
494+ >apple</dt
495+ ><dd
496+ ><p
497+ >red fruit</p
498+ ></dd
499+ ><dt
500+ >orange</dt
501+ ><dd
502+ ><p
503+ >orange fruit</p
504+ ></dd
505+ ><dt
506+ >banana</dt
507+ ><dd
508+ ><p
509+ >yellow fruit</p
510+ ></dd
511+ ></dl
493512 ><p
494− >orange fruit</p
495− ><pre
496− ><code
497− >{ orange code block }
498−</code
499− ></pre
500− ><blockquote
513+ >Multiple blocks with italics:</p
514+ ><dl
515+ ><dt
516+ ><em
517+ >apple</em
518+ ></dt
519+ ><dd
501520 ><p
502− >orange block quote</p
503− ></blockquote
504− ></dd
505− ></dl
506− ><h1 id="html-blocks"
507− >HTML Blocks</h1
508− ><p
509− >Simple block on one line:</p
510− ><div>foo</div>
521+ >red fruit</p
522+ ><p
523+ >contains seeds, crisp, pleasant to taste</p
524+ ></dd
525+ ><dt
526+ ><em
527+ >orange</em
528+ ></dt
529+ ><dd
530+ ><p
531+ >orange fruit</p
532+ ><pre
533+ ><code
534+ >{ orange code block }
535+</code
536+ ></pre
537+ ><blockquote
538+ ><p
539+ >orange block quote</p
540+ ></blockquote
541+ ></dd
542+ ></dl
543+ ></div
544+ ><div id="html-blocks"
545+ ><h1
546+ >HTML Blocks</h1
547+ ><p
548+ >Simple block on one line:</p
549+ ><div>foo</div>
511550<p
512− >And nested without indentation:</p
513− ><div>
551+ >And nested without indentation:</p
552+ ><div>
514553<div>
515554<div>foo</div>
516555</div>
517556<div>bar</div>
518557</div>
519558<p
520− >Interpreted markdown in a table:</p
521− ><table>
559+ >Interpreted markdown in a table:</p
560+ ><table>
522561<tr>
523562<td>This is <em
524− >emphasized</em
525− ></td>
563+ >emphasized</em
564+ ></td>
526565<td>And this is <strong
527− >strong</strong
528− ></td>
566+ >strong</strong
567+ ></td>
529568</tr>
530569</table>
531570
532571<script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
533572<p
534− >Here&rsquo;s a simple block:</p
535− ><div>
573+ >Here&rsquo;s a simple block:</p
574+ ><div>
536575 foo</div>
537576<p
538− >This should be a code block, though:</p
539− ><pre
540− ><code
541− >&lt;div&gt;
577+ >This should be a code block, though:</p
578+ ><pre
579+ ><code
580+ >&lt;div&gt;
542581 foo
543582&lt;/div&gt;
544583</code
545− ></pre
546− ><p
547− >As should this:</p
548− ><pre
549− ><code
550− >&lt;div&gt;foo&lt;/div&gt;
584+ ></pre
585+ ><p
586+ >As should this:</p
587+ ><pre
588+ ><code
589+ >&lt;div&gt;foo&lt;/div&gt;
551590</code
552− ></pre
553− ><p
554− >Now, nested:</p
555− ><div>
591+ ></pre
592+ ><p
593+ >Now, nested:</p
594+ ><div>
556595 <div>
557596 <div>
558597 foo</div>
559598 </div>
560599</div>
561600<p
562− >This should just be an HTML comment:</p
563− ><!-- Comment -->
601+ >This should just be an HTML comment:</p
602+ ><!-- Comment -->
564603<p
565− >Multiline:</p
566− ><!--
604+ >Multiline:</p
605+ ><!--
567606Blah
568607Blah
569608-->
@@ -572,25 +611,25 @@ Blah
572611 This is another comment.
573612-->
574613<p
575− >Code block:</p
576− ><pre
577− ><code
578− >&lt;!-- Comment --&gt;
614+ >Code block:</p
615+ ><pre
616+ ><code
617+ >&lt;!-- Comment --&gt;
579618</code
580− ></pre
581− ><p
582− >Just plain comment, with trailing spaces on the line:</p
583− ><!-- foo -->
619+ ></pre
620+ ><p
621+ >Just plain comment, with trailing spaces on the line:</p
622+ ><!-- foo -->
584623<p
585− >Code:</p
586− ><pre
587− ><code
588− >&lt;hr /&gt;
624+ >Code:</p
625+ ><pre
626+ ><code
627+ >&lt;hr /&gt;
589628</code
590− ></pre
591− ><p
592− >Hr&rsquo;s:</p
593− ><hr>
629+ ></pre
630+ ><p
631+ >Hr&rsquo;s:</p
632+ ><hr>
594633
595634<hr />
596635
@@ -608,474 +647,497 @@ Blah
608647
609648<hr class="foo" id="bar">
610649<hr
611− /><h1 id="inline-markup"
612− >Inline Markup</h1
613− ><p
614− >This is <em
615− >emphasized</em
616− >, and so <em
617− >is this</em
618− >.</p
619− ><p
620− >This is <strong
621− >strong</strong
622− >, and so <strong
623− >is this</strong
624− >.</p
625− ><p
626− >An <em
627− ><a href="/url"
628− >emphasized link</a
629− ></em
630− >.</p
631− ><p
632− ><strong
633− ><em
634− >This is strong and em.</em
635− ></strong
636− ></p
637− ><p
638− >So is <strong
639− ><em
640− >this</em
641− ></strong
642− > word.</p
643− ><p
644− ><strong
645− ><em
646− >This is strong and em.</em
647− ></strong
648− ></p
649− ><p
650− >So is <strong
651− ><em
652− >this</em
653− ></strong
654− > word.</p
655− ><p
656− >This is code: <code
657− >&gt;</code
658− >, <code
659− >$</code
660− >, <code
661− >\</code
662− >, <code
663− >\$</code
664− >, <code
665− >&lt;html&gt;</code
666− >.</p
667− ><p
668− ><span style="text-decoration: line-through;"
650+ /></div
651+ ><div id="inline-markup"
652+ ><h1
653+ >Inline Markup</h1
654+ ><p
669655 >This is <em
670− >strikeout</em
671− >.</span
672− ></p
673− ><p
674− >Superscripts: a<sup
675− >bc</sup
676− >d a<sup
677− ><em
678− >hello</em
679− ></sup
680− > a<sup
681− >hello&nbsp;there</sup
682− >.</p
683− ><p
684− >Subscripts: H<sub
685− >2</sub
686− >O, H<sub
687− >23</sub
688− >O, H<sub
689− >many&nbsp;of&nbsp;them</sub
690− >O.</p
691− ><p
692− >These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.</p
693− ><hr
694− /><h1 id="smart-quotes-ellipses-dashes"
695− >Smart quotes, ellipses, dashes</h1
696− ><p
697− >&ldquo;Hello,&rdquo; said the spider. &ldquo;&lsquo;Shelob&rsquo; is my name.&rdquo;</p
698− ><p
699− >&lsquo;A&rsquo;, &lsquo;B&rsquo;, and &lsquo;C&rsquo; are letters.</p
700− ><p
701− >&lsquo;Oak,&rsquo; &lsquo;elm,&rsquo; and &lsquo;beech&rsquo; are names of trees. So is &lsquo;pine.&rsquo;</p
702− ><p
703− >&lsquo;He said, &ldquo;I want to go.&rdquo;&rsquo; Were you alive in the 70&rsquo;s?</p
704− ><p
705− >Here is some quoted &lsquo;<code
706− >code</code
707− >&rsquo; and a &ldquo;<a href="http://example.com/?foo=1&amp;bar=2"
708− >quoted link</a
709− >&rdquo;.</p
710− ><p
711− >Some dashes: one&mdash;two &mdash; three&mdash;four &mdash; five.</p
712− ><p
713− >Dashes between numbers: 5&ndash;7, 255&ndash;66, 1987&ndash;1999.</p
714− ><p
715− >Ellipses&hellip;and&hellip;and&hellip;.</p
716− ><hr
717− /><h1 id="latex"
718− >LaTeX</h1
719− ><ul
720− ><li
721− ></li
722− ><li
723− ><span class="math"
724− >2+2=4</span
725− ></li
726− ><li
727− ><span class="math"
656+ >emphasized</em
657+ >, and so <em
658+ >is this</em
659+ >.</p
660+ ><p
661+ >This is <strong
662+ >strong</strong
663+ >, and so <strong
664+ >is this</strong
665+ >.</p
666+ ><p
667+ >An <em
668+ ><a href="/url"
669+ >emphasized link</a
670+ ></em
671+ >.</p
672+ ><p
673+ ><strong
728674 ><em
729− >x</em
730− >&#8201;&#8712;&#8201;<em
731− >y</em
732− ></span
733− ></li
734− ><li
735− ><span class="math"
736− >&#945;&#8201;&#8743;&#8201;&#969;</span
737− ></li
738− ><li
739− ><span class="math"
740− >223</span
741− ></li
742− ><li
743− ><span class="math"
675+ >This is strong and em.</em
676+ ></strong
677+ ></p
678+ ><p
679+ >So is <strong
680+ ><em
681+ >this</em
682+ ></strong
683+ > word.</p
684+ ><p
685+ ><strong
686+ ><em
687+ >This is strong and em.</em
688+ ></strong
689+ ></p
690+ ><p
691+ >So is <strong
692+ ><em
693+ >this</em
694+ ></strong
695+ > word.</p
696+ ><p
697+ >This is code: <code
698+ >&gt;</code
699+ >, <code
700+ >$</code
701+ >, <code
702+ >\</code
703+ >, <code
704+ >\$</code
705+ >, <code
706+ >&lt;html&gt;</code
707+ >.</p
708+ ><p
709+ ><span style="text-decoration: line-through;"
710+ >This is <em
711+ >strikeout</em
712+ >.</span
713+ ></p
714+ ><p
715+ >Superscripts: a<sup
716+ >bc</sup
717+ >d a<sup
744718 ><em
745− >p</em
746− ></span
747− >-Tree</li
719+ >hello</em
720+ ></sup
721+ > a<sup
722+ >hello&nbsp;there</sup
723+ >.</p
724+ ><p
725+ >Subscripts: H<sub
726+ >2</sub
727+ >O, H<sub
728+ >23</sub
729+ >O, H<sub
730+ >many&nbsp;of&nbsp;them</sub
731+ >O.</p
732+ ><p
733+ >These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.</p
734+ ><hr
735+ /></div
736+ ><div id="smart-quotes-ellipses-dashes"
737+ ><h1
738+ >Smart quotes, ellipses, dashes</h1
739+ ><p
740+ >&ldquo;Hello,&rdquo; said the spider. &ldquo;&lsquo;Shelob&rsquo; is my name.&rdquo;</p
741+ ><p
742+ >&lsquo;A&rsquo;, &lsquo;B&rsquo;, and &lsquo;C&rsquo; are letters.</p
743+ ><p
744+ >&lsquo;Oak,&rsquo; &lsquo;elm,&rsquo; and &lsquo;beech&rsquo; are names of trees. So is &lsquo;pine.&rsquo;</p
745+ ><p
746+ >&lsquo;He said, &ldquo;I want to go.&rdquo;&rsquo; Were you alive in the 70&rsquo;s?</p
747+ ><p
748+ >Here is some quoted &lsquo;<code
749+ >code</code
750+ >&rsquo; and a &ldquo;<a href="http://example.com/?foo=1&amp;bar=2"
751+ >quoted link</a
752+ >&rdquo;.</p
753+ ><p
754+ >Some dashes: one&mdash;two &mdash; three&mdash;four &mdash; five.</p
755+ ><p
756+ >Dashes between numbers: 5&ndash;7, 255&ndash;66, 1987&ndash;1999.</p
757+ ><p
758+ >Ellipses&hellip;and&hellip;and&hellip;.</p
759+ ><hr
760+ /></div
761+ ><div id="latex"
762+ ><h1
763+ >LaTeX</h1
764+ ><ul
748765 ><li
749− >Here&rsquo;s some display math: <span class="math"
750− >\frac{<em
751− >d</em
752− >}{<em
753− >dx</em
754− >}<em
755− >f</em
756− >(<em
757− >x</em
758− >)=\lim<sub
766+ ></li
767+ ><li
768+ ><span class="math"
769+ >2+2=4</span
770+ ></li
771+ ><li
772+ ><span class="math"
759773 ><em
760− >h</em
761− >&#8201;&#8594;&#8201;0</sub
774+ >x</em
775+ >&#8201;&#8712;&#8201;<em
776+ >y</em
777+ ></span
778+ ></li
779+ ><li
780+ ><span class="math"
781+ >&#945;&#8201;&#8743;&#8201;&#969;</span
782+ ></li
783+ ><li
784+ ><span class="math"
785+ >223</span
786+ ></li
787+ ><li
788+ ><span class="math"
789+ ><em
790+ >p</em
791+ ></span
792+ >-Tree</li
793+ ><li
794+ >Here&rsquo;s some display math: <span class="math"
762795 >\frac{<em
763− >f</em
764− >(<em
765− >x</em
766− >+<em
767− >h</em
768− >)-<em
769− >f</em
770− >(<em
771− >x</em
772− >)}{<em
773− >h</em
774− >}</span
775− ></li
776− ><li
777− >Here&rsquo;s one that has a line break in it: <span class="math"
778− >&#945;+&#969;&#8201;×&#8201;<em
779− >x</em
780− ><sup
781− >2</sup
782− ></span
783− >.</li
784− ></ul
785− ><p
786− >These shouldn&rsquo;t be math:</p
787− ><ul
788− ><li
789− >To get the famous equation, write <code
790− >$e = mc^2$</code
791− >.</li
792− ><li
793− >$22,000 is a <em
794− >lot</em
795− > of money. So is $34,000. (It worked if &ldquo;lot&rdquo; is emphasized.)</li
796− ><li
797− >Shoes ($20) and socks ($5).</li
798− ><li
799− >Escaped <code
800− >$</code
801− >: $73 <em
802− >this should be emphasized</em
803− > 23$.</li
804− ></ul
805− ><p
806− >Here&rsquo;s a LaTeX table:</p
807− ><p
808− ></p
809− ><hr
810− /><h1 id="special-characters"
811− >Special Characters</h1
812− ><p
813− >Here is some unicode:</p
814− ><ul
815− ><li
816− >I hat: Î</li
817− ><li
818− >o umlaut: ö</li
819− ><li
820− >section: §</li
821− ><li
822− >set membership: &#8712;</li
796+ >d</em
797+ >}{<em
798+ >dx</em
799+ >}<em
800+ >f</em
801+ >(<em
802+ >x</em
803+ >)=\lim<sub
804+ ><em
805+ >h</em
806+ >&#8201;&#8594;&#8201;0</sub
807+ >\frac{<em
808+ >f</em
809+ >(<em
810+ >x</em
811+ >+<em
812+ >h</em
813+ >)-<em
814+ >f</em
815+ >(<em
816+ >x</em
817+ >)}{<em
818+ >h</em
819+ >}</span
820+ ></li
821+ ><li
822+ >Here&rsquo;s one that has a line break in it: <span class="math"
823+ >&#945;+&#969;&#8201;×&#8201;<em
824+ >x</em
825+ ><sup
826+ >2</sup
827+ ></span
828+ >.</li
829+ ></ul
830+ ><p
831+ >These shouldn&rsquo;t be math:</p
832+ ><ul
823833 ><li
824− >copyright: ©</li
825− ></ul
826− ><p
827− >AT&amp;T has an ampersand in their name.</p
828− ><p
829− >AT&amp;T is another way to write it.</p
830− ><p
831− >This &amp; that.</p
832− ><p
833− >4 &lt; 5.</p
834− ><p
835− >6 &gt; 5.</p
836− ><p
837− >Backslash: \</p
838− ><p
839− >Backtick: `</p
840− ><p
841− >Asterisk: *</p
842− ><p
843− >Underscore: _</p
844− ><p
845− >Left brace: {</p
846− ><p
847− >Right brace: }</p
848− ><p
849− >Left bracket: [</p
850− ><p
851− >Right bracket: ]</p
852− ><p
853− >Left paren: (</p
854− ><p
855− >Right paren: )</p
856− ><p
857− >Greater-than: &gt;</p
858− ><p
859− >Hash: #</p
860− ><p
861− >Period: .</p
862− ><p
863− >Bang: !</p
864− ><p
865− >Plus: +</p
866− ><p
867− >Minus: -</p
868− ><hr
869− /><h1 id="links"
870− >Links</h1
871− ><h2 id="explicit"
872− >Explicit</h2
873− ><p
874− >Just a <a href="/url/"
875− >URL</a
876− >.</p
877− ><p
878− ><a href="/url/" title="title"
879− >URL and title</a
880− >.</p
881− ><p
882− ><a href="/url/" title="title preceded by two spaces"
883− >URL and title</a
884− >.</p
885− ><p
886− ><a href="/url/" title="title preceded by a tab"
887− >URL and title</a
888− >.</p
889− ><p
890− ><a href="/url/" title="title with &quot;quotes&quot; in it"
891− >URL and title</a
892− ></p
893− ><p
894− ><a href="/url/" title="title with single quotes"
895− >URL and title</a
896− ></p
897− ><p
898− ><a href="/url/with_underscore"
899− >with_underscore</a
834+ >To get the famous equation, write <code
835+ >$e = mc^2$</code
836+ >.</li
837+ ><li
838+ >$22,000 is a <em
839+ >lot</em
840+ > of money. So is $34,000. (It worked if &ldquo;lot&rdquo; is emphasized.)</li
841+ ><li
842+ >Shoes ($20) and socks ($5).</li
843+ ><li
844+ >Escaped <code
845+ >$</code
846+ >: $73 <em
847+ >this should be emphasized</em
848+ > 23$.</li
849+ ></ul
850+ ><p
851+ >Here&rsquo;s a LaTeX table:</p
852+ ><p
900853 ></p
901− ><p
902− ><script type="text/javascript"
903− >
854+ ><hr
855+ /></div
856+ ><div id="special-characters"
857+ ><h1
858+ >Special Characters</h1
859+ ><p
860+ >Here is some unicode:</p
861+ ><ul
862+ ><li
863+ >I hat: Î</li
864+ ><li
865+ >o umlaut: ö</li
866+ ><li
867+ >section: §</li
868+ ><li
869+ >set membership: &#8712;</li
870+ ><li
871+ >copyright: ©</li
872+ ></ul
873+ ><p
874+ >AT&amp;T has an ampersand in their name.</p
875+ ><p
876+ >AT&amp;T is another way to write it.</p
877+ ><p
878+ >This &amp; that.</p
879+ ><p
880+ >4 &lt; 5.</p
881+ ><p
882+ >6 &gt; 5.</p
883+ ><p
884+ >Backslash: \</p
885+ ><p
886+ >Backtick: `</p
887+ ><p
888+ >Asterisk: *</p
889+ ><p
890+ >Underscore: _</p
891+ ><p
892+ >Left brace: {</p
893+ ><p
894+ >Right brace: }</p
895+ ><p
896+ >Left bracket: [</p
897+ ><p
898+ >Right bracket: ]</p
899+ ><p
900+ >Left paren: (</p
901+ ><p
902+ >Right paren: )</p
903+ ><p
904+ >Greater-than: &gt;</p
905+ ><p
906+ >Hash: #</p
907+ ><p
908+ >Period: .</p
909+ ><p
910+ >Bang: !</p
911+ ><p
912+ >Plus: +</p
913+ ><p
914+ >Minus: -</p
915+ ><hr
916+ /></div
917+ ><div id="links"
918+ ><h1
919+ >Links</h1
920+ ><div id="explicit"
921+ ><h2
922+ >Explicit</h2
923+ ><p
924+ >Just a <a href="/url/"
925+ >URL</a
926+ >.</p
927+ ><p
928+ ><a href="/url/" title="title"
929+ >URL and title</a
930+ >.</p
931+ ><p
932+ ><a href="/url/" title="title preceded by two spaces"
933+ >URL and title</a
934+ >.</p
935+ ><p
936+ ><a href="/url/" title="title preceded by a tab"
937+ >URL and title</a
938+ >.</p
939+ ><p
940+ ><a href="/url/" title="title with &quot;quotes&quot; in it"
941+ >URL and title</a
942+ ></p
943+ ><p
944+ ><a href="/url/" title="title with single quotes"
945+ >URL and title</a
946+ ></p
947+ ><p
948+ ><a href="/url/with_underscore"
949+ >with_underscore</a
950+ ></p
951+ ><p
952+ ><script type="text/javascript"
953+ >
904954<!--
905955h='&#110;&#x6f;&#x77;&#104;&#x65;&#114;&#x65;&#46;&#110;&#x65;&#116;';a='&#64;';n='&#110;&#x6f;&#98;&#x6f;&#100;&#x79;';e=n+a+h;
906956document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'Email link'+'<\/'+'a'+'>');
907957// -->
908958</script
909− ><noscript
910− >&#x45;&#x6d;&#x61;&#x69;&#108;&#32;&#108;&#x69;&#110;&#x6b;&#32;&#40;&#110;&#x6f;&#98;&#x6f;&#100;&#x79;&#32;&#x61;&#116;&#32;&#110;&#x6f;&#x77;&#104;&#x65;&#114;&#x65;&#32;&#100;&#x6f;&#116;&#32;&#110;&#x65;&#116;&#x29;</noscript
911− ></p
912− ><p
913− ><a href=""
914− >Empty</a
915− >.</p
916− ><h2 id="reference"
917− >Reference</h2
918− ><p
919− >Foo <a href="/url/"
920− >bar</a
921− >.</p
922− ><p
923− >Foo <a href="/url/"
924− >bar</a
925− >.</p
926− ><p
927− >Foo <a href="/url/"
928− >bar</a
929− >.</p
930− ><p
931− >With <a href="/url/"
932− >embedded [brackets]</a
933− >.</p
934− ><p
935− ><a href="/url/"
936− >b</a
937− > by itself should be a link.</p
938− ><p
939− >Indented <a href="/url"
940− >once</a
941− >.</p
942− ><p
943− >Indented <a href="/url"
944− >twice</a
945− >.</p
946− ><p
947− >Indented <a href="/url"
948− >thrice</a
949− >.</p
950− ><p
951− >This should [not][] be a link.</p
952− ><pre
953− ><code
954− >[not]: /url
955−</code
956− ></pre
957− ><p
958− >Foo <a href="/url/" title="Title with &quot;quotes&quot; inside"
959− >bar</a
960− >.</p
961− ><p
962− >Foo <a href="/url/" title="Title with &quot;quote&quot; inside"
963− >biz</a
964− >.</p
965− ><h2 id="with-ampersands"
966− >With ampersands</h2
967− ><p
968− >Here&rsquo;s a <a href="http://example.com/?foo=1&amp;bar=2"
969− >link with an ampersand in the URL</a
970− >.</p
971− ><p
972− >Here&rsquo;s a link with an amersand in the link text: <a href="http://att.com/" title="AT&amp;T"
973− >AT&amp;T</a
974− >.</p
975− ><p
976− >Here&rsquo;s an <a href="/script?foo=1&amp;bar=2"
977− >inline link</a
978− >.</p
979− ><p
980− >Here&rsquo;s an <a href="/script?foo=1&amp;bar=2"
981− >inline link in pointy braces</a
982− >.</p
983− ><h2 id="autolinks"
984− >Autolinks</h2
985− ><p
986− >With an ampersand: <a href="http://example.com/?foo=1&amp;bar=2"
987− ><code
988− >http://example.com/?foo=1&amp;bar=2</code
989− ></a
990− ></p
991− ><ul
992− ><li
993− >In a list?</li
994− ><li
995− ><a href="http://example.com/"
959+ ><noscript
960+ >&#x45;&#x6d;&#x61;&#x69;&#108;&#32;&#108;&#x69;&#110;&#x6b;&#32;&#40;&#110;&#x6f;&#98;&#x6f;&#100;&#x79;&#32;&#x61;&#116;&#32;&#110;&#x6f;&#x77;&#104;&#x65;&#114;&#x65;&#32;&#100;&#x6f;&#116;&#32;&#110;&#x65;&#116;&#x29;</noscript
961+ ></p
962+ ><p
963+ ><a href=""
964+ >Empty</a
965+ >.</p
966+ ></div
967+ ><div id="reference"
968+ ><h2
969+ >Reference</h2
970+ ><p
971+ >Foo <a href="/url/"
972+ >bar</a
973+ >.</p
974+ ><p
975+ >Foo <a href="/url/"
976+ >bar</a
977+ >.</p
978+ ><p
979+ >Foo <a href="/url/"
980+ >bar</a
981+ >.</p
982+ ><p
983+ >With <a href="/url/"
984+ >embedded [brackets]</a
985+ >.</p
986+ ><p
987+ ><a href="/url/"
988+ >b</a
989+ > by itself should be a link.</p
990+ ><p
991+ >Indented <a href="/url"
992+ >once</a
993+ >.</p
994+ ><p
995+ >Indented <a href="/url"
996+ >twice</a
997+ >.</p
998+ ><p
999+ >Indented <a href="/url"
1000+ >thrice</a
1001+ >.</p
1002+ ><p
1003+ >This should [not][] be a link.</p
1004+ ><pre
9961005 ><code
997− >http://example.com/</code
998− ></a
999− ></li
1000− ><li
1001− >It should.</li
1002− ></ul
1003− ><p
1004− >An e-mail address: <script type="text/javascript"
1005− >
1006+ >[not]: /url
1007+</code
1008+ ></pre
1009+ ><p
1010+ >Foo <a href="/url/" title="Title with &quot;quotes&quot; inside"
1011+ >bar</a
1012+ >.</p
1013+ ><p
1014+ >Foo <a href="/url/" title="Title with &quot;quote&quot; inside"
1015+ >biz</a
1016+ >.</p
1017+ ></div
1018+ ><div id="with-ampersands"
1019+ ><h2
1020+ >With ampersands</h2
1021+ ><p
1022+ >Here&rsquo;s a <a href="http://example.com/?foo=1&amp;bar=2"
1023+ >link with an ampersand in the URL</a
1024+ >.</p
1025+ ><p
1026+ >Here&rsquo;s a link with an amersand in the link text: <a href="http://att.com/" title="AT&amp;T"
1027+ >AT&amp;T</a
1028+ >.</p
1029+ ><p
1030+ >Here&rsquo;s an <a href="/script?foo=1&amp;bar=2"
1031+ >inline link</a
1032+ >.</p
1033+ ><p
1034+ >Here&rsquo;s an <a href="/script?foo=1&amp;bar=2"
1035+ >inline link in pointy braces</a
1036+ >.</p
1037+ ></div
1038+ ><div id="autolinks"
1039+ ><h2
1040+ >Autolinks</h2
1041+ ><p
1042+ >With an ampersand: <a href="http://example.com/?foo=1&amp;bar=2"
1043+ ><code
1044+ >http://example.com/?foo=1&amp;bar=2</code
1045+ ></a
1046+ ></p
1047+ ><ul
1048+ ><li
1049+ >In a list?</li
1050+ ><li
1051+ ><a href="http://example.com/"
1052+ ><code
1053+ >http://example.com/</code
1054+ ></a
1055+ ></li
1056+ ><li
1057+ >It should.</li
1058+ ></ul
1059+ ><p
1060+ >An e-mail address: <script type="text/javascript"
1061+ >
10061062<!--
10071063h='&#110;&#x6f;&#x77;&#104;&#x65;&#114;&#x65;&#46;&#110;&#x65;&#116;';a='&#64;';n='&#110;&#x6f;&#98;&#x6f;&#100;&#x79;';e=n+a+h;
10081064document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'<code>'+e+'</code>'+'<\/'+'a'+'>');
10091065// -->
10101066</script
1011− ><noscript
1012− >&#110;&#x6f;&#98;&#x6f;&#100;&#x79;&#32;&#x61;&#116;&#32;&#110;&#x6f;&#x77;&#104;&#x65;&#114;&#x65;&#32;&#100;&#x6f;&#116;&#32;&#110;&#x65;&#116;</noscript
1013− ></p
1014− ><blockquote
1015− ><p
1016− >Blockquoted: <a href="http://example.com/"
1067+ ><noscript
1068+ >&#110;&#x6f;&#98;&#x6f;&#100;&#x79;&#32;&#x61;&#116;&#32;&#110;&#x6f;&#x77;&#104;&#x65;&#114;&#x65;&#32;&#100;&#x6f;&#116;&#32;&#110;&#x65;&#116;</noscript
1069+ ></p
1070+ ><blockquote
1071+ ><p
1072+ >Blockquoted: <a href="http://example.com/"
1073+ ><code
1074+ >http://example.com/</code
1075+ ></a
1076+ ></p
1077+ ></blockquote
1078+ ><p
1079+ >Auto-links should not occur here: <code
1080+ >&lt;http://example.com/&gt;</code
1081+ ></p
1082+ ><pre
10171083 ><code
1018− >http://example.com/</code
1019− ></a
1020− ></p
1021− ></blockquote
1022− ><p
1023− >Auto-links should not occur here: <code
1024− >&lt;http://example.com/&gt;</code
1025− ></p
1026− ><pre
1027− ><code
1028− >or here: &lt;http://example.com/&gt;
1084+ >or here: &lt;http://example.com/&gt;
10291085</code
1030− ></pre
1031− ><hr
1032− /><h1 id="images"
1033− >Images</h1
1034− ><p
1035− >From &ldquo;Voyage dans la Lune&rdquo; by Georges Melies (1902):</p
1036− ><p
1037− ><img src="lalune.jpg" title="Voyage dans la Lune" alt="lalune"
1038− /></p
1039− ><p
1040− >Here is a movie <img src="movie.jpg" alt="movie"
1041− /> icon.</p
1042− ><hr
1043− /><h1 id="footnotes"
1044− >Footnotes</h1
1045− ><p
1046− >Here is a footnote reference,<a href="#fn1" class="footnoteRef" id="fnref1"
1047− ><sup
1048− >1</sup
1049− ></a
1050− > and another.<a href="#fn2" class="footnoteRef" id="fnref2"
1051− ><sup
1052− >2</sup
1053− ></a
1054− > This should <em
1055− >not</em
1056− > be a footnote reference, because it contains a space.[^my note] Here is an inline note.<a href="#fn3" class="footnoteRef" id="fnref3"
1057− ><sup
1058− >3</sup
1059− ></a
1060− ></p
1061− ><blockquote
1062− ><p
1063− >Notes can go in quotes.<a href="#fn4" class="footnoteRef" id="fnref4"
1086+ ></pre
1087+ ><hr
1088+ /></div
1089+ ></div
1090+ ><div id="images"
1091+ ><h1
1092+ >Images</h1
1093+ ><p
1094+ >From &ldquo;Voyage dans la Lune&rdquo; by Georges Melies (1902):</p
1095+ ><p
1096+ ><img src="lalune.jpg" title="Voyage dans la Lune" alt="lalune"
1097+ /></p
1098+ ><p
1099+ >Here is a movie <img src="movie.jpg" alt="movie"
1100+ /> icon.</p
1101+ ><hr
1102+ /></div
1103+ ><div id="footnotes"
1104+ ><h1
1105+ >Footnotes</h1
1106+ ><p
1107+ >Here is a footnote reference,<a href="#fn1" class="footnoteRef" id="fnref1"
10641108 ><sup
1065− >4</sup
1109+ >1</sup
10661110 ></a
1067− ></p
1068− ></blockquote
1069− ><ol style="list-style-type: decimal;"
1070− ><li
1071− >And in list items.<a href="#fn5" class="footnoteRef" id="fnref5"
1111+ > and another.<a href="#fn2" class="footnoteRef" id="fnref2"
10721112 ><sup
1073− >5</sup
1113+ >2</sup
10741114 ></a
1075− ></li
1076− ></ol
1077− ><p
1078− >This paragraph should not be part of the note, as it is not indented.</p
1115+ > This should <em
1116+ >not</em
1117+ > be a footnote reference, because it contains a space.[^my note] Here is an inline note.<a href="#fn3" class="footnoteRef" id="fnref3"
1118+ ><sup
1119+ >3</sup
1120+ ></a
1121+ ></p
1122+ ><blockquote
1123+ ><p
1124+ >Notes can go in quotes.<a href="#fn4" class="footnoteRef" id="fnref4"
1125+ ><sup
1126+ >4</sup
1127+ ></a
1128+ ></p
1129+ ></blockquote
1130+ ><ol style="list-style-type: decimal;"
1131+ ><li
1132+ >And in list items.<a href="#fn5" class="footnoteRef" id="fnref5"
1133+ ><sup
1134+ >5</sup
1135+ ></a
1136+ ></li
1137+ ></ol
1138+ ><p
1139+ >This paragraph should not be part of the note, as it is not indented.</p
1140+ ></div
10791141 ><div class="footnotes"
10801142 ><hr
10811143 /><ol