git.iko.soy/typeable/pandoc
on master help sign in
Merged changes from 'quotes' branch since r431. Smart typography

is now handled in the Markdown and LaTeX readers, rather than in the writers. The HTML writer has been rewritten to use the prettyprinting library. git-svn-id: https://pandoc.googlecode.com/svn/trunk@436 788f1e2b-df1e-0410-8736-df70ead52e1b

commitbb8478e4e24b431ca81ee7f669d517eb11a47500 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSat 6 Jan 2007, 09:54 (20 years ago) parent06e6107
31 files changed+1250−1297
README+4−2 debian/changelog+9−3 man/man1/pandoc.1+4−2 src/Main.hs+3−3 src/Text/Pandoc/Definition.hs+8 src/Text/Pandoc/Entities.hs+8−3 src/Text/Pandoc/Readers/LaTeX.hs+52−22 src/Text/Pandoc/Readers/Markdown.hs+62−12 src/Text/Pandoc/Shared.hs+24−68 src/Text/Pandoc/Writers/Docbook.hs+43−35 src/Text/Pandoc/Writers/HTML.hs+139−127 src/Text/Pandoc/Writers/LaTeX.hs+11−32 src/Text/Pandoc/Writers/Markdown.hs+17−6 src/Text/Pandoc/Writers/RST.hs+8 src/Text/Pandoc/Writers/RTF.hs+8 tests/generate.sh−1 tests/runtests.pl+3−3 tests/s5.basic.html+14−11 tests/s5.fancy.html+14−11 tests/s5.fragment.html+3−11 tests/s5.inserts.html+9−12 tests/s5.native−6 tests/testsuite.native+57−57 tests/writer.docbook+32−29 tests/writer.html+627−276 tests/writer.latex+2−2 tests/writer.markdown+2−2 tests/writer.native+57−57 tests/writer.rst+2−2 tests/writer.rtf+28−28 tests/writer.smart.html−474
README+4−2
@@ -262,9 +262,11 @@ in the title as it appears at the beginning of the HTML body). (See
262262below on Titles.)
263263
264264`-S` or `--smart` causes `pandoc` to produce typographically
265−correct HTML output, along the lines of John Gruber's [Smartypants].
265+correct output, along the lines of John Gruber's [Smartypants].
266266Straight quotes are converted to curly quotes, `---` to dashes, and
267−`...` to ellipses.
267+`...` to ellipses. (Note: This option is only significant when
268+the input format is `markdown`. It is selected automatically
269+when the output format is `latex`.)
268270
269271[Smartypants]: http://daringfireball.net/projects/smartypants/
270272
debian/changelog+9−3
@@ -79,6 +79,8 @@ pandoc (0.3) unstable; urgency=low
7979 of the next line.
8080 + Fixed bug in text-wrapping routine in Markdown and RST writers.
8181 Now LineBreaks no longer cause wrapping problems.
82+ + Fixed bug with inline Code in Markdown writer. Now it's guaranteed
83+ that enough `'s will be used, depending on the content.
8284
8385 * Made handling of code blocks more consistent. Previously, some
8486 readers allowed trailing newlines, while others stripped them.
@@ -108,9 +110,13 @@ pandoc (0.3) unstable; urgency=low
108110 + Process quotes before dashes. This way (foo -- 'bar') will turn into
109111 (foo---`bar') instead of (foo---'bar').
110112
111− * Improved handling of smart quotes in HTML and LaTeX writers, to
112− handle cases where latex commands or HTML entity references appear
113− after quotes.
113+ * Moved handling of "smart typography" from the writers to the Markdown
114+ and LaTeX readers. This allows great simplification of the writers
115+ and more accurate smart quotes, dashes, and ellipses. DocBook can
116+ now use '<quote>'. The '--smart' option now toggles an option in
117+ the parser state rather than a writer option. Several new kinds
118+ of inline elements have been added: Quoted, Ellipses, Apostrophe,
119+ EmDash, EnDash.
114120
115121 * Changes in HTML writer:
116122 + Include title block in header even when title is null.
man/man1/pandoc.1+4−2
@@ -108,8 +108,10 @@ Use strict markdown syntax, with no extensions or variants.
108108Parse untranslatable HTML codes and LaTeX environments as raw HTML
109109or LaTeX, instead of ignoring them.
110110.TP
111−.B \-S, \-\-smartypants
112−Use smart quotes, dashes, and ellipses in HTML output.
111+.B \-S, \-\-smart
112+Use smart quotes, dashes, and ellipses. (This option is significant
113+only when the input format is \fBmarkdown\fR. It is selected automatically
114+when the output format is \fBlatex\fR.)
113115.TP
114116.B \-m, \-\-asciimathml
115117Use ASCIIMathML to display embedded LaTeX math in HTML output.
src/Main.hs+3−3
@@ -190,7 +190,7 @@ options =
190190 , Option "S" ["smart"]
191191 (NoArg
192192 (\opt -> return opt { optSmart = True }))
193− "" -- "Use smart quotes, dashes, and ellipses in HTML output"
193+ "" -- "Use smart quotes, dashes, and ellipses"
194194
195195 , Option "m" ["asciimathml"]
196196 (NoArg
@@ -423,6 +423,8 @@ main = do
423423 defaultParserState { stateParseRaw = parseRaw,
424424 stateTabStop = tabStop,
425425 stateStandalone = standalone && (not strict),
426+ stateSmart = (smart && (not strict)) ||
427+ writerName' == "latex",
426428 stateStrict = strict }
427429 let csslink = if (css == "")
428430 then ""
@@ -437,8 +439,6 @@ main = do
437439 (not strict),
438440 writerHeader = header,
439441 writerTitlePrefix = titlePrefix,
440− writerSmart = smart &&
441− (not strict),
442442 writerTabStop = tabStop,
443443 writerNotes = [],
444444 writerS5 = (writerName=="s5"),
src/Text/Pandoc/Definition.hs+8
@@ -65,13 +65,21 @@ data Target
6565 | Ref [Inline] -- ^ Label (list of inlines) for an indirect ref
6666 deriving (Show, Eq, Read)
6767
68+-- | Type of quotation marks to use in Quoted inline.
69+data QuoteType = SingleQuote | DoubleQuote deriving (Show, Eq, Read)
70+
6871-- | Inline elements.
6972data Inline
7073 = Str String -- ^ Text (string)
7174 | Emph [Inline] -- ^ Emphasized text (list of inlines)
7275 | Strong [Inline] -- ^ Strongly emphasized text (list of inlines)
76+ | Quoted QuoteType [Inline] -- ^ Quoted text (list of inlines)
7377 | Code String -- ^ Inline code (literal)
7478 | Space -- ^ Inter-word space
79+ | EmDash -- ^ Em dash
80+ | EnDash -- ^ En dash
81+ | Apostrophe -- ^ Apostrophe
82+ | Ellipses -- ^ Ellipses
7583 | LineBreak -- ^ Hard line break
7684 | TeX String -- ^ LaTeX code (literal)
7785 | HtmlInline String -- ^ HTML code (literal)
src/Text/Pandoc/Entities.hs+8−3
@@ -32,14 +32,19 @@ module Text.Pandoc.Entities (
3232 entityToChar,
3333 charToEntity,
3434 decodeEntities,
35− encodeEntities
35+ encodeEntities,
36+ characterEntity
3637 ) where
3738import Data.Char ( chr, ord )
38−import Text.Regex ( mkRegex, matchRegexAll )
39+import Text.Regex ( mkRegex, matchRegexAll, Regex )
3940import Maybe ( fromMaybe )
4041
41−-- regexs for entities
42+-- | Regular expression for decimal coded entity.
43+decimalCodedEntity :: Text.Regex.Regex
4244decimalCodedEntity = mkRegex "&#([0-9]+);"
45+
46+-- | Regular expression for character entity.
47+characterEntity :: Text.Regex.Regex
4348characterEntity = mkRegex "&#[0-9]+;|&[A-Za-z0-9]+;"
4449
4550-- | Return a string with all entity references decoded to unicode characters
src/Text/Pandoc/Readers/LaTeX.hs+52−22
@@ -50,23 +50,12 @@ readLaTeX = readWith parseLaTeX
5050testString = testStringWith parseLaTeX
5151
5252-- characters with special meaning
53−specialChars = "\\$%&^&_~#{}\n \t|<>"
53+specialChars = "\\$%&^&_~#{}\n \t|<>'\"-"
5454
5555--
5656-- utility functions
5757--
5858
59−-- | Change quotation marks in a string back to "basic" quotes.
60−normalizeQuotes :: String -> String
61−normalizeQuotes = gsub "''" "\"" . gsub "`" "'"
62−
63−-- | Change LaTeX En dashes between digits to hyphens.
64−normalizeDashes :: String -> String
65−normalizeDashes = gsub "([0-9])--([0-9])" "\\1-\\2"
66−
67−normalizePunctuation :: String -> String
68−normalizePunctuation = normalizeDashes . normalizeQuotes
69−
7059-- | Returns text between brackets and its matching pair.
7160bracketedText openB closeB = try (do
7261 char openB
@@ -132,10 +121,10 @@ anyEnvironment = try (do
132121--
133122
134123-- | Process LaTeX preamble, extracting metadata.
135−processLaTeXPreamble = do
124+processLaTeXPreamble = try (do
136125 manyTill (choice [bibliographic, comment, unknownCommand, nullBlock])
137126 (try (string "\\begin{document}"))
138− spaces
127+ spaces)
139128
140129-- | Parse LaTeX and return 'Pandoc'.
141130parseLaTeX = do
@@ -392,16 +381,13 @@ comment = try (do
392381-- inline
393382--
394383
395−inline = choice [ strong, emph, ref, lab, code, linebreak, math, ldots,
384+inline = choice [ strong, emph, ref, lab, code, linebreak, math, ellipses,
385+ emDash, enDash, hyphen, quoted, apostrophe,
396386 accentedChar, specialChar, specialInline, escapedChar,
397387 unescapedChar, str, endline, whitespace ] <?> "inline"
398388
399−specialInline = choice [ link, image, footnote, rawLaTeXInline ] <?>
400− "link, raw TeX, note, or image"
401−
402−ldots = try (do
403− string "\\ldots"
404− return (Str "..."))
389+specialInline = choice [ link, image, footnote, rawLaTeXInline ]
390+ <?> "link, raw TeX, note, or image"
405391
406392accentedChar = normalAccentedChar <|> specialAccentedChar
407393
@@ -526,6 +512,49 @@ emph = try (do
526512 result <- manyTill inline (char '}')
527513 return (Emph result))
528514
515+apostrophe = do
516+ char '\''
517+ return Apostrophe
518+
519+quoted = do
520+ doubleQuoted <|> singleQuoted
521+
522+singleQuoted = try (do
523+ result <- enclosed singleQuoteStart singleQuoteEnd inline
524+ return $ Quoted SingleQuote $ normalizeSpaces result)
525+
526+doubleQuoted = try (do
527+ result <- enclosed doubleQuoteStart doubleQuoteEnd inline
528+ return $ Quoted DoubleQuote $ normalizeSpaces result)
529+
530+singleQuoteStart = char '`'
531+
532+singleQuoteEnd = try (do
533+ char '\''
534+ notFollowedBy alphaNum)
535+
536+doubleQuoteStart = try (string "``")
537+
538+doubleQuoteEnd = try (string "''")
539+
540+ellipses = try (do
541+ string "\\ldots"
542+ option "" (string "{}")
543+ return Ellipses)
544+
545+enDash = try (do
546+ string "--"
547+ notFollowedBy (char '-')
548+ return EnDash)
549+
550+emDash = try (do
551+ string "---"
552+ return EmDash)
553+
554+hyphen = do
555+ char '-'
556+ return (Str "-")
557+
529558lab = try (do
530559 string "\\label{"
531560 result <- manyTill anyChar (char '}')
@@ -552,7 +581,7 @@ linebreak = try (do
552581
553582str = do
554583 result <- many1 (noneOf specialChars)
555− return (Str (normalizePunctuation result))
584+ return (Str result)
556585
557586-- endline internal to paragraph
558587endline = try (do
@@ -624,3 +653,4 @@ rawLaTeXInline = try (do
624653 then fail "not an inline command"
625654 else string ""
626655 return (TeX ("\\" ++ name ++ star ++ argStr)))
656+
src/Text/Pandoc/Readers/Markdown.hs+62−12
@@ -86,12 +86,13 @@ titleOpeners = "\"'("
8686setextHChars = ['=','-']
8787blockQuoteChar = '>'
8888hyphenChar = '-'
89+ellipsesChar = '.'
8990
9091-- treat these as potentially non-text when parsing inline:
9192specialChars = [escapeChar, labelStart, labelEnd, emphStart, emphEnd,
9293 emphStartAlt, emphEndAlt, codeStart, codeEnd, autoLinkEnd,
9394 autoLinkStart, mathStart, mathEnd, imageStart, noteStart,
94− hyphenChar]
95+ hyphenChar, ellipsesChar] ++ quoteChars
9596
9697--
9798-- auxiliary functions
@@ -120,6 +121,11 @@ failUnlessBeginningOfLine = do
120121 pos <- getPosition
121122 if sourceColumn pos == 1 then return () else fail "not beginning of line"
122123
124+-- | Fail unless we're in "smart typography" mode.
125+failUnlessSmart = do
126+ state <- getState
127+ if stateSmart state then return () else fail "Smart typography feature"
128+
123129--
124130-- document structure
125131--
@@ -519,11 +525,11 @@ rawLaTeXEnvironment' = do
519525-- inline
520526--
521527
522−text = choice [ math, strong, emph, code, str, linebreak, tabchar,
523− whitespace, endline ] <?> "text"
528+text = choice [ escapedChar, math, strong, emph, smartPunctuation,
529+ code, ltSign, symbol,
530+ str, linebreak, tabchar, whitespace, endline ] <?> "text"
524531
525−inline = choice [ rawLaTeXInline', escapedChar, special, hyphens, text,
526− ltSign, symbol ] <?> "inline"
532+inline = choice [ rawLaTeXInline', escapedChar, special, text ] <?> "inline"
527533
528534special = choice [ noteRef, inlineNote, link, referenceLink, rawHtmlInline',
529535 autoLink, image ] <?> "link, inline html, note, or image"
@@ -531,6 +537,7 @@ special = choice [ noteRef, inlineNote, link, referenceLink, rawHtmlInline',
531537escapedChar = escaped anyChar
532538
533539ltSign = try (do
540+ notFollowedBy (noneOf "<") -- continue only if it's a <
534541 notFollowedBy' rawHtmlBlocks -- don't return < if it starts html
535542 char '<'
536543 return (Str ['<']))
@@ -541,13 +548,6 @@ symbol = do
541548 result <- oneOf specialCharsMinusLt
542549 return (Str [result])
543550
544−hyphens = try (do
545− result <- many1 (char '-')
546− if (length result) == 1
547− then skipEndline -- don't want to treat endline after hyphen as a space
548− else do{ string ""; return Space }
549− return (Str result))
550−
551551-- parses inline code, between n codeStarts and n codeEnds
552552code = try (do
553553 starts <- many1 (char codeStart)
@@ -583,6 +583,56 @@ strong = do
583583 (count 2 (char emphEndAlt)) inline) ]
584584 return (Strong (normalizeSpaces result))
585585
586+smartPunctuation = do
587+ failUnlessSmart
588+ choice [ quoted, apostrophe, dash, ellipses ]
589+
590+apostrophe = do
591+ char '\'' <|> char '\8217'
592+ return Apostrophe
593+
594+quoted = do
595+ doubleQuoted <|> singleQuoted
596+
597+singleQuoted = try (do
598+ result <- enclosed singleQuoteStart singleQuoteEnd
599+ (do{notFollowedBy' singleQuoted; inline} <|> apostrophe)
600+ return $ Quoted SingleQuote $ normalizeSpaces result)
601+
602+doubleQuoted = try (do
603+ result <- enclosed doubleQuoteStart doubleQuoteEnd inline
604+ return $ Quoted DoubleQuote $ normalizeSpaces result)
605+
606+singleQuoteStart = try (do
607+ char '\'' <|> char '\8216'
608+ notFollowedBy' whitespace)
609+
610+singleQuoteEnd = try (do
611+ oneOfStrings ["'", "\8217"]
612+ notFollowedBy alphaNum)
613+
614+doubleQuoteStart = char '"' <|> char '\8220'
615+
616+doubleQuoteEnd = char '"' <|> char '\8221'
617+
618+ellipses = try (do
619+ oneOfStrings ["...", " . . . ", ". . .", " . . ."]
620+ return Ellipses)
621+
622+dash = enDash <|> emDash
623+
624+enDash = try (do
625+ char '-'
626+ followedBy' (many1 digit)
627+ return EnDash)
628+
629+emDash = try (do
630+ skipSpaces
631+ oneOfStrings ["---", "--"]
632+ skipSpaces
633+ option ' ' newline
634+ return EmDash)
635+
586636whitespace = do
587637 many1 (oneOf spaceChars) <?> "whitespace"
588638 return Space
src/Text/Pandoc/Shared.hs+24−68
@@ -52,7 +52,6 @@ module Text.Pandoc.Shared (
5252 -- * Native format prettyprinting
5353 prettyPandoc,
5454 -- * Pandoc block list processing
55− consolidateList,
5655 isNoteBlock,
5756 normalizeSpaces,
5857 compactify,
@@ -74,7 +73,7 @@ module Text.Pandoc.Shared (
7473 ) where
7574import Text.Pandoc.Definition
7675import Text.ParserCombinators.Parsec
77−import Text.Pandoc.Entities ( decodeEntities, encodeEntities )
76+import Text.Pandoc.Entities ( decodeEntities, encodeEntities, characterEntity )
7877import Text.Regex ( matchRegexAll, mkRegex, subRegex, Regex )
7978import Text.PrettyPrint.HughesPJ as PP ( text, char, (<>), ($$), nest, Doc,
8079 isEmpty )
@@ -125,6 +124,7 @@ data ParserState = ParserState
125124 stateAuthors :: [String], -- ^ Authors of document
126125 stateDate :: String, -- ^ Date of document
127126 stateStrict :: Bool, -- ^ Use strict markdown syntax
127+ stateSmart :: Bool, -- ^ Use smart typography
128128 stateHeaderTable :: [HeaderType] -- ^ List of header types used,
129129 -- in what order (rst only)
130130 }
@@ -144,19 +144,9 @@ defaultParserState =
144144 stateAuthors = [],
145145 stateDate = [],
146146 stateStrict = False,
147+ stateSmart = False,
147148 stateHeaderTable = [] }
148149
149−-- | Consolidate @Str@s and @Space@s in an inline list into one big @Str@.
150−-- Collapse adjacent @Space@s.
151−consolidateList :: [Inline] -> [Inline]
152−consolidateList ((Str a):(Str b):rest) = consolidateList ((Str (a ++ b)):rest)
153−consolidateList ((Str a):Space:Space:rest) = consolidateList ((Str a):Space:rest)
154−consolidateList ((Str a):Space:rest) = consolidateList ((Str (a ++ " ")):rest)
155−consolidateList (Space:(Str a):rest) = consolidateList ((Str (" " ++ a)):rest)
156−consolidateList (Space:Space:rest) = consolidateList ((Str " "):rest)
157−consolidateList (inline:rest) = inline:(consolidateList rest)
158−consolidateList [] = []
159−
160150-- | Indent string as a block.
161151indentBy :: Int -- ^ Number of spaces to indent the block
162152 -> Int -- ^ Number of spaces (rel to block) to indent first line
@@ -341,7 +331,6 @@ data WriterOptions = WriterOptions
341331 , writerHeader :: String -- ^ Header for the document
342332 , writerIncludeBefore :: String -- ^ String to include before the body
343333 , writerIncludeAfter :: String -- ^ String to include after the body
344− , writerSmart :: Bool -- ^ Use smart typography
345334 , writerS5 :: Bool -- ^ We're writing S5
346335 , writerIncremental :: Bool -- ^ Incremental S5 lists
347336 , writerNumberSections :: Bool -- ^ Number sections in LaTeX
@@ -463,6 +452,8 @@ refsMatch ((Emph x):restx) ((Emph y):resty) =
463452 refsMatch x y && refsMatch restx resty
464453refsMatch ((Strong x):restx) ((Strong y):resty) =
465454 refsMatch x y && refsMatch restx resty
455+refsMatch ((Quoted t x):restx) ((Quoted u y):resty) =
456+ t == u && refsMatch x y && refsMatch restx resty
466457refsMatch (x:restx) (y:resty) = (x == y) && refsMatch restx resty
467458refsMatch [] x = null x
468459refsMatch x [] = null x
@@ -517,48 +508,14 @@ replaceRefLinksInline keytable (Emph lst) =
517508 Emph (map (replaceRefLinksInline keytable) lst)
518509replaceRefLinksInline keytable (Strong lst) =
519510 Strong (map (replaceRefLinksInline keytable) lst)
511+replaceRefLinksInline keytable (Quoted t lst) =
512+ Quoted t (map (replaceRefLinksInline keytable) lst)
520513replaceRefLinksInline keytable other = other
521514
522−-- | Escape string, preserving character entities and quote, and adding
523−-- smart typography if specified.
524−stringToSGML :: WriterOptions -> String -> String
525−stringToSGML options =
526− let escapeDoubleQuotes =
527− gsub "(\"|&quot;)" "&rdquo;" . -- rest are right quotes
528− gsub "(\"|&quot;)(&r[sd]quo;)" "&rdquo;\\2" .
529− -- never left quo before right quo
530− gsub "(&l[sd]quo;)(\"|&quot;)" "\\2&ldquo;" .
531− -- never right quo after left quo
532− gsub "([ \t])(\"|&quot;)" "\\1&ldquo;" .
533− -- never right quo after space
534− gsub "(\"|&quot;)([^,.;:!?^) \t-])" "&ldquo;\\2" . -- "word left
535− gsub "(\"|&quot;)('|`|&lsquo;)" "&rdquo;&rsquo;" .
536− -- right if it got through last filter
537− gsub "(\"|&quot;)('|`|&lsquo;)([^,.;:!?^) \t-])" "&ldquo;&lsquo;\\3" .
538− -- "'word left
539− gsub "``" "&ldquo;" .
540− gsub "''" "&rdquo;"
541− escapeSingleQuotes =
542− gsub "'" "&rsquo;" . -- otherwise right
543− gsub "'(&r[sd]quo;)" "&rsquo;\\1" . -- never left quo before right quo
544− gsub "(&l[sd]quo;)'" "\\1&lsquo;" . -- never right quo after left quo
545− gsub "([ \t])'" "\\1&lsquo;" . -- never right quo after space
546− gsub "`" "&lsquo;" . -- ` is left
547− gsub "([^,.;:!?^) \t-])'" "\\1&rsquo;" . -- word' right
548− gsub "^('|`)([^,.;:!?^) \t-])" "&lsquo;\\2" . -- 'word left
549− gsub "('|`)(\"|&quot;|&ldquo;|``)" "&lsquo;&ldquo;" . -- '"word left
550− gsub "([^,.;:!?^) \t-])'(s|S)" "\\1&rsquo;\\2" . -- possessive
551− gsub "([[:space:]])'([^,.;:!?^) \t-])" "\\1&lsquo;\\2" . -- 'word left
552− gsub "'([0-9][0-9](s|S))" "&rsquo;\\1" -- '80s - decade abbrevs.
553− escapeDashes =
554− gsub " ?-- ?" "&mdash;" .
555− gsub " ?--- ?" "&mdash;" .
556− gsub "([0-9])--?([0-9])" "\\1&ndash;\\2"
557− escapeEllipses = gsub "\\.\\.\\.|\\. \\. \\." "&hellip;"
558− smartFilter = escapeSingleQuotes . escapeDoubleQuotes . escapeDashes .
559− escapeEllipses in
560− encodeEntities . (if (writerSmart options) then smartFilter else id) .
561− (escapePreservingRegex escapeSGML (mkRegex "&[[:alnum:]]*;"))
515+-- | Escape string, preserving character entities.
516+stringToSGML :: String -> String
517+stringToSGML =
518+ encodeEntities . (escapePreservingRegex escapeSGML characterEntity)
562519
563520-- | Escape string as needed for HTML. Entity references are not preserved.
564521escapeSGML :: String -> String
@@ -571,16 +528,15 @@ escapeSGML (x:xs) = case x of
571528 _ -> x:(escapeSGML xs)
572529
573530-- | Return a text object with a string of formatted SGML attributes.
574−attributeList :: WriterOptions -> [(String, String)] -> Doc
575−attributeList options =
576− text . concatMap (\(a, b) -> " " ++ stringToSGML options a ++ "=\"" ++
577− stringToSGML options b ++ "\"")
531+attributeList :: [(String, String)] -> Doc
532+attributeList = text . concatMap
533+ (\(a, b) -> " " ++ stringToSGML a ++ "=\"" ++ stringToSGML b ++ "\"")
578534
579535-- | Put the supplied contents between start and end tags of tagType,
580536-- with specified attributes and (if specified) indentation.
581−inTags:: Bool -> WriterOptions -> String -> [(String, String)] -> Doc -> Doc
582−inTags isIndented options tagType attribs contents =
583− let openTag = PP.char '<' <> text tagType <> attributeList options attribs <>
537+inTags:: Bool -> String -> [(String, String)] -> Doc -> Doc
538+inTags isIndented tagType attribs contents =
539+ let openTag = PP.char '<' <> text tagType <> attributeList attribs <>
584540 PP.char '>'
585541 closeTag = text "</" <> text tagType <> PP.char '>' in
586542 if isIndented
@@ -588,15 +544,15 @@ inTags isIndented options tagType attribs contents =
588544 else openTag <> contents <> closeTag
589545
590546-- | Return a self-closing tag of tagType with specified attributes
591−selfClosingTag :: WriterOptions -> String -> [(String, String)] -> Doc
592−selfClosingTag options tagType attribs =
593− PP.char '<' <> text tagType <> attributeList options attribs <> text " />"
547+selfClosingTag :: String -> [(String, String)] -> Doc
548+selfClosingTag tagType attribs =
549+ PP.char '<' <> text tagType <> attributeList attribs <> text " />"
594550
595551-- | Put the supplied contents between start and end tags of tagType.
596−inTagsSimple :: WriterOptions -> String -> Doc -> Doc
597−inTagsSimple options tagType = inTags False options tagType []
552+inTagsSimple :: String -> Doc -> Doc
553+inTagsSimple tagType = inTags False tagType []
598554
599555-- | Put the supplied contents in indented block btw start and end tags.
600−inTagsIndented :: WriterOptions -> String -> Doc -> Doc
601−inTagsIndented options tagType = inTags True options tagType []
556+inTagsIndented :: String -> Doc -> Doc
557+inTagsIndented tagType = inTags True tagType []
602558
src/Text/Pandoc/Writers/Docbook.hs+43−35
@@ -59,14 +59,14 @@ hierarchicalize (block:rest) =
5959 x -> (Blk x):(hierarchicalize rest)
6060
6161-- | Convert list of authors to a docbook <author> section
62−authorToDocbook :: WriterOptions -> [Char] -> Doc
63−authorToDocbook opts name = inTagsIndented opts "author" $
62+authorToDocbook :: [Char] -> Doc
63+authorToDocbook name = inTagsIndented "author" $
6464 if ',' `elem` name
6565 then -- last name first
6666 let (lastname, rest) = break (==',') name
6767 firstname = removeLeadingSpace rest in
68− inTagsSimple opts "firstname" (text $ stringToSGML opts firstname) <>
69− inTagsSimple opts "surname" (text $ stringToSGML opts lastname)
68+ inTagsSimple "firstname" (text $ stringToSGML firstname) <>
69+ inTagsSimple "surname" (text $ stringToSGML lastname)
7070 else -- last name last
7171 let namewords = words name
7272 lengthname = length namewords
@@ -74,8 +74,8 @@ authorToDocbook opts name = inTagsIndented opts "author" $
7474 0 -> ("","")
7575 1 -> ("", name)
7676 n -> (joinWithSep " " (take (n-1) namewords), last namewords) in
77− inTagsSimple opts "firstname" (text $ stringToSGML opts firstname) $$
78− inTagsSimple opts "surname" (text $ stringToSGML opts lastname)
77+ inTagsSimple "firstname" (text $ stringToSGML firstname) $$
78+ inTagsSimple "surname" (text $ stringToSGML lastname)
7979
8080-- | Convert Pandoc document to string in Docbook format.
8181writeDocbook :: WriterOptions -> Pandoc -> String
@@ -84,22 +84,24 @@ writeDocbook opts (Pandoc (Meta title authors date) blocks) =
8484 then text (writerHeader opts)
8585 else empty
8686 meta = if (writerStandalone opts)
87− then inTagsIndented opts "articleinfo" $
88− (inTagsSimple opts "title" (inlinesToDocbook opts title)) $$
89− (vcat (map (authorToDocbook opts) authors)) $$
90− (inTagsSimple opts "date" (text $ stringToSGML opts date))
87+ then inTagsIndented "articleinfo" $
88+ (inTagsSimple "title" (wrap opts title)) $$
89+ (vcat (map authorToDocbook authors)) $$
90+ (inTagsSimple "date" (text $ stringToSGML date))
9191 else empty
9292 blocks' = replaceReferenceLinks blocks
9393 (noteBlocks, blocks'') = partition isNoteBlock blocks'
9494 opts' = opts {writerNotes = noteBlocks}
9595 elements = hierarchicalize blocks''
96− body = text (writerIncludeBefore opts') <>
96+ before = writerIncludeBefore opts'
97+ after = writerIncludeAfter opts'
98+ body = (if null before then empty else text before) $$
9799 vcat (map (elementToDocbook opts') elements) $$
98− text (writerIncludeAfter opts')
100+ (if null after then empty else text after)
99101 body' = if writerStandalone opts'
100− then inTagsIndented opts "article" (meta $$ body)
102+ then inTagsIndented "article" (meta $$ body)
101103 else body in
102− render $ head $$ body' <> text "\n"
104+ render $ head $$ body' $$ text ""
103105
104106-- | Convert an Element to Docbook.
105107elementToDocbook :: WriterOptions -> Element -> Doc
@@ -109,8 +111,8 @@ elementToDocbook opts (Sec title elements) =
109111 let elements' = if null elements
110112 then [Blk (Para [])]
111113 else elements in
112− inTagsIndented opts "section" $
113− inTagsSimple opts "title" (wrap opts title) $$
114+ inTagsIndented "section" $
115+ inTagsSimple "title" (wrap opts title) $$
114116 vcat (map (elementToDocbook opts) elements')
115117
116118-- | Convert a list of Pandoc blocks to Docbook.
@@ -128,7 +130,7 @@ listItemToDocbook opts item =
128130 let plainToPara (Plain x) = Para x
129131 plainToPara y = y in
130132 let item' = map plainToPara item in
131− inTagsIndented opts "listitem" (blocksToDocbook opts item')
133+ inTagsIndented "listitem" (blocksToDocbook opts item')
132134
133135-- | Convert a Pandoc block element to Docbook.
134136blockToDocbook :: WriterOptions -> Block -> Doc
@@ -136,20 +138,20 @@ blockToDocbook opts Blank = text ""
136138blockToDocbook opts Null = empty
137139blockToDocbook opts (Plain lst) = wrap opts lst
138140blockToDocbook opts (Para lst) =
139− inTagsIndented opts "para" (wrap opts lst)
141+ inTagsIndented "para" (wrap opts lst)
140142blockToDocbook opts (BlockQuote blocks) =
141− inTagsIndented opts "blockquote" (blocksToDocbook opts blocks)
143+ inTagsIndented "blockquote" (blocksToDocbook opts blocks)
142144blockToDocbook opts (CodeBlock str) =
143145 text "<screen>\n" <> text (escapeSGML str) <> text "\n</screen>"
144146blockToDocbook opts (BulletList lst) =
145− inTagsIndented opts "itemizedlist" $ listItemsToDocbook opts lst
147+ inTagsIndented "itemizedlist" $ listItemsToDocbook opts lst
146148blockToDocbook opts (OrderedList lst) =
147− inTagsIndented opts "orderedlist" $ listItemsToDocbook opts lst
149+ inTagsIndented "orderedlist" $ listItemsToDocbook opts lst
148150blockToDocbook opts (RawHtml str) = text str -- raw XML block
149151blockToDocbook opts HorizontalRule = empty -- not semantic
150152blockToDocbook opts (Note _ _) = empty -- shouldn't occur
151153blockToDocbook opts (Key _ _) = empty -- shouldn't occur
152−blockToDocbook opts _ = inTagsIndented opts "para" (text "Unknown block type")
154+blockToDocbook opts _ = inTagsIndented "para" (text "Unknown block type")
153155
154156-- | Put string in CDATA section
155157cdata :: String -> Doc
@@ -165,14 +167,20 @@ inlinesToDocbook opts lst = hcat (map (inlineToDocbook opts) lst)
165167
166168-- | Convert an inline element to Docbook.
167169inlineToDocbook :: WriterOptions -> Inline -> Doc
168−inlineToDocbook opts (Str str) = text $ stringToSGML opts str
170+inlineToDocbook opts (Str str) = text $ stringToSGML str
169171inlineToDocbook opts (Emph lst) =
170− inTagsSimple opts "emphasis" (inlinesToDocbook opts lst)
172+ inTagsSimple "emphasis" (inlinesToDocbook opts lst)
171173inlineToDocbook opts (Strong lst) =
172− inTags False opts "emphasis" [("role", "strong")]
174+ inTags False "emphasis" [("role", "strong")]
173175 (inlinesToDocbook opts lst)
176+inlineToDocbook opts (Quoted _ lst) =
177+ inTagsSimple "quote" (inlinesToDocbook opts lst)
178+inlineToDocbook opts Apostrophe = text "&apos;"
179+inlineToDocbook opts Ellipses = text "&hellip;"
180+inlineToDocbook opts EmDash = text "&mdash;"
181+inlineToDocbook opts EnDash = text "&ndash;"
174182inlineToDocbook opts (Code str) =
175− inTagsSimple opts "literal" $ text (escapeSGML str)
183+ inTagsSimple "literal" $ text (escapeSGML str)
176184inlineToDocbook opts (TeX str) = inlineToDocbook opts (Code str)
177185inlineToDocbook opts (HtmlInline str) = empty
178186inlineToDocbook opts LineBreak =
@@ -180,19 +188,19 @@ inlineToDocbook opts LineBreak =
180188inlineToDocbook opts Space = char ' '
181189inlineToDocbook opts (Link txt (Src src tit)) =
182190 case (matchRegex (mkRegex "mailto:(.*)") src) of
183− Just [addr] -> inTagsSimple opts "email" $ text (escapeSGML addr)
184− Nothing -> inTags False opts "ulink" [("url", src)] $
191+ Just [addr] -> inTagsSimple "email" $ text (escapeSGML addr)
192+ Nothing -> inTags False "ulink" [("url", src)] $
185193 inlinesToDocbook opts txt
186194inlineToDocbook opts (Link text (Ref ref)) = empty -- shouldn't occur
187195inlineToDocbook opts (Image alt (Src src tit)) =
188196 let titleDoc = if null tit
189197 then empty
190− else inTagsIndented opts "objectinfo" $
191− inTagsIndented opts "title"
192− (text $ stringToSGML opts tit) in
193− inTagsIndented opts "inlinemediaobject" $
194− inTagsIndented opts "imageobject" $
195− titleDoc $$ selfClosingTag opts "imagedata" [("fileref", src)]
198+ else inTagsIndented "objectinfo" $
199+ inTagsIndented "title"
200+ (text $ stringToSGML tit) in
201+ inTagsIndented "inlinemediaobject" $
202+ inTagsIndented "imageobject" $
203+ titleDoc $$ selfClosingTag "imagedata" [("fileref", src)]
196204inlineToDocbook opts (Image alternate (Ref ref)) = empty --shouldn't occur
197205inlineToDocbook opts (NoteRef ref) =
198206 let notes = writerNotes opts
@@ -200,4 +208,4 @@ inlineToDocbook opts (NoteRef ref) =
200208 if null hits
201209 then empty
202210 else let (Note _ contents) = head hits in
203− inTagsIndented opts "footnote" $ blocksToDocbook opts contents
211+ inTagsIndented "footnote" $ blocksToDocbook opts contents
src/Text/Pandoc/Writers/HTML.hs+139−127
@@ -37,48 +37,53 @@ import Text.Regex ( mkRegex, matchRegex )
3737import Numeric ( showHex )
3838import Data.Char ( ord, toLower )
3939import Data.List ( isPrefixOf, partition )
40+import Text.PrettyPrint.HughesPJ hiding ( Str )
4041
4142-- | Convert Pandoc document to string in HTML format.
4243writeHtml :: WriterOptions -> Pandoc -> String
43−writeHtml options (Pandoc (Meta title authors date) blocks) =
44− let titlePrefix = writerTitlePrefix options in
44+writeHtml opts (Pandoc (Meta title authors date) blocks) =
45+ let titlePrefix = writerTitlePrefix opts in
4546 let topTitle = if not (null titlePrefix)
4647 then [Str titlePrefix] ++ (if not (null title)
4748 then [Str " - "] ++ title
4849 else [])
4950 else title in
50− let head = if (writerStandalone options)
51− then htmlHeader options (Meta topTitle authors date)
52− else ""
53− titleBlocks = if (writerStandalone options) && (not (null title)) &&
54− (not (writerS5 options))
51+ let head = if (writerStandalone opts)
52+ then htmlHeader opts (Meta topTitle authors date)
53+ else empty
54+ titleBlocks = if (writerStandalone opts) && (not (null title)) &&
55+ (not (writerS5 opts))
5556 then [RawHtml "<h1 class=\"title\">", Plain title,
56− RawHtml "</h1>\n"]
57+ RawHtml "</h1>"]
5758 else []
58− foot = if (writerStandalone options) then "</body>\n</html>\n" else ""
59+ foot = if (writerStandalone opts)
60+ then text "</body>\n</html>"
61+ else empty
5962 blocks' = replaceReferenceLinks (titleBlocks ++ blocks)
6063 (noteBlocks, blocks'') = partition isNoteBlock blocks'
61− body = (writerIncludeBefore options) ++
62− concatMap (blockToHtml options) blocks'' ++
63− footnoteSection options noteBlocks ++
64− (writerIncludeAfter options) in
65− head ++ body ++ foot
64+ before = writerIncludeBefore opts
65+ after = writerIncludeAfter opts
66+ body = (if null before then empty else text before) $$
67+ vcat (map (blockToHtml opts) blocks'') $$
68+ footnoteSection opts noteBlocks $$
69+ (if null after then empty else text after) in
70+ render $ head $$ body $$ foot $$ text ""
6671
6772-- | Convert list of Note blocks to a footnote <div>.
6873-- Assumes notes are sorted.
69−footnoteSection :: WriterOptions -> [Block] -> String
70−footnoteSection options notes =
74+footnoteSection :: WriterOptions -> [Block] -> Doc
75+footnoteSection opts notes =
7176 if null notes
72− then ""
73− else "<div class=\"footnotes\">\n<hr />\n<ol>\n" ++
74− concatMap (blockToHtml options) notes ++
75− "</ol>\n</div>\n"
77+ then empty
78+ else inTags True "div" [("class","footnotes")] $
79+ selfClosingTag "hr" [] $$ (inTagsIndented "ol"
80+ (vcat $ map (blockToHtml opts) notes))
7681
7782-- | Obfuscate a "mailto:" link using Javascript.
78−obfuscateLink :: WriterOptions -> [Inline] -> String -> String
79−obfuscateLink options text src =
83+obfuscateLink :: WriterOptions -> [Inline] -> String -> Doc
84+obfuscateLink opts txt src =
8085 let emailRegex = mkRegex "mailto:*([^@]*)@(.*)"
81− text' = inlineListToHtml options text
86+ text' = render $ inlineListToHtml opts txt
8287 src' = map toLower src in
8388 case (matchRegex emailRegex src') of
8489 (Just [name, domain]) ->
@@ -91,16 +96,17 @@ obfuscateLink options text src =
9196 then name ++ " at " ++ domain'
9297 else text' ++ " (" ++ name ++ " at " ++
9398 domain' ++ ")" in
94− if writerStrictMarkdown options
95− then "<a href=\"" ++ obfuscateString src' ++ "\">" ++
96− obfuscateString text' ++ "</a>"
97− else "<script type=\"text/javascript\">\n<!--\nh='" ++
99+ if writerStrictMarkdown opts
100+ then inTags False "a" [("href", obfuscateString src')] $
101+ text $ obfuscateString text'
102+ else inTags False "script" [("type", "text/javascript")]
103+ (text ("\n<!--\nh='" ++
98104 obfuscateString domain ++ "';a='" ++ at' ++ "';n='" ++
99105 obfuscateString name ++ "';e=n+a+h;\n" ++
100106 "document.write('<a h'+'ref'+'=\"ma'+'ilto'+':'+e+'\">'+" ++
101− linkText ++ "+'<\\/'+'a'+'>');\n// -->\n</script><noscript>" ++
102− obfuscateString altText ++ "</noscript>"
103− _ -> "<a href=\"" ++ src ++ "\">" ++ text' ++ "</a>" -- malformed email
107+ linkText ++ "+'<\\/'+'a'+'>');\n// -->\n")) <>
108+ inTagsSimple "noscript" (text (obfuscateString altText))
109+ _ -> inTags False "a" [("href", src)] (text text') -- malformed email
104110
105111-- | Obfuscate character as entity.
106112obfuscateChar :: Char -> String
@@ -113,117 +119,123 @@ obfuscateChar char =
113119obfuscateString :: String -> String
114120obfuscateString = concatMap obfuscateChar
115121
116−-- | Returns an HTML header with appropriate bibliographic information.
117−htmlHeader :: WriterOptions -> Meta -> String
118−htmlHeader options (Meta title authors date) =
119− let titletext = "<title>" ++ (inlineListToHtml options title) ++
120− "</title>\n"
122+-- | Return an HTML header with appropriate bibliographic information.
123+htmlHeader :: WriterOptions -> Meta -> Doc
124+htmlHeader opts (Meta title authors date) =
125+ let titletext = inTagsSimple "title" (wrap opts title)
121126 authortext = if (null authors)
122− then ""
123− else "<meta name=\"author\" content=\"" ++
124− (joinWithSep ", " (map (stringToSGML options) authors)) ++
125− "\" />\n"
127+ then empty
128+ else selfClosingTag "meta" [("name", "author"),
129+ ("content",
130+ joinWithSep ", " (map stringToSGML authors))]
126131 datetext = if (date == "")
127− then ""
128− else "<meta name=\"date\" content=\"" ++
129− (stringToSGML options date) ++ "\" />\n" in
130− (writerHeader options) ++ authortext ++ datetext ++ titletext ++
131− "</head>\n<body>\n"
132+ then empty
133+ else selfClosingTag "meta" [("name", "date"),
134+ ("content", stringToSGML date)] in
135+ text (writerHeader opts) $$ authortext $$ datetext $$ titletext $$
136+ text "</head>\n<body>"
137+
138+-- | Take list of inline elements and return wrapped doc.
139+wrap :: WriterOptions -> [Inline] -> Doc
140+wrap opts lst = fsep $ map (inlineListToHtml opts) (splitBy Space lst)
132141
133142-- | Convert Pandoc block element to HTML.
134−blockToHtml :: WriterOptions -> Block -> String
135−blockToHtml options Blank = "\n"
136−blockToHtml options Null = ""
137−blockToHtml options (Plain lst) = inlineListToHtml options lst
138−blockToHtml options (Para lst) = "<p>" ++ (inlineListToHtml options lst) ++ "</p>\n"
139−blockToHtml options (BlockQuote blocks) =
140− if (writerS5 options)
143+blockToHtml :: WriterOptions -> Block -> Doc
144+blockToHtml opts Blank = text ""
145+blockToHtml opts Null = empty
146+blockToHtml opts (Plain lst) = wrap opts lst
147+blockToHtml opts (Para lst) = inTagsIndented "p" $ wrap opts lst
148+blockToHtml opts (BlockQuote blocks) =
149+ if (writerS5 opts)
141150 then -- in S5, treat list in blockquote specially
142151 -- if default is incremental, make it nonincremental;
143152 -- otherwise incremental
144− let inc = not (writerIncremental options) in
153+ let inc = not (writerIncremental opts) in
145154 case blocks of
146− [BulletList lst] -> blockToHtml (options {writerIncremental =
155+ [BulletList lst] -> blockToHtml (opts {writerIncremental =
147156 inc}) (BulletList lst)
148− [OrderedList lst] -> blockToHtml (options {writerIncremental =
157+ [OrderedList lst] -> blockToHtml (opts {writerIncremental =
149158 inc}) (OrderedList lst)
150− otherwise -> "<blockquote>\n" ++
151− (concatMap (blockToHtml options) blocks) ++
152− "</blockquote>\n"
153− else "<blockquote>\n" ++ (concatMap (blockToHtml options) blocks) ++
154− "</blockquote>\n"
155−blockToHtml options (Note ref lst) =
156− let contents = (concatMap (blockToHtml options) lst) in
157− "<li id=\"fn" ++ ref ++ "\">" ++ contents ++ " <a href=\"#fnref" ++ ref ++
158− "\" class=\"footnoteBacklink\" title=\"Jump back to footnote " ++ ref ++
159− "\">&#8617;</a></li>\n"
160−blockToHtml options (Key _ _) = ""
161−blockToHtml options (CodeBlock str) =
162− "<pre><code>" ++ (escapeSGML str) ++ "\n</code></pre>\n"
163−blockToHtml options (RawHtml str) = str
164−blockToHtml options (BulletList lst) =
165− let attribs = if (writerIncremental options)
166− then " class=\"incremental\""
167− else "" in
168− "<ul" ++ attribs ++ ">\n" ++ (concatMap (listItemToHtml options) lst) ++
169− "</ul>\n"
170−blockToHtml options (OrderedList lst) =
171− let attribs = if (writerIncremental options)
172− then " class=\"incremental\""
173− else "" in
174− "<ol" ++ attribs ++ ">\n" ++ (concatMap (listItemToHtml options) lst) ++
175− "</ol>\n"
176−blockToHtml options HorizontalRule = "<hr />\n"
177−blockToHtml options (Header level lst) =
178− let contents = inlineListToHtml options lst in
159+ otherwise -> inTagsIndented "blockquote" $
160+ vcat $ map (blockToHtml opts) blocks
161+ else inTagsIndented "blockquote" $ vcat $ map (blockToHtml opts) blocks
162+blockToHtml opts (Note ref lst) =
163+ let contents = (vcat $ map (blockToHtml opts) lst) in
164+ inTags True "li" [("id", "fn" ++ ref)] $
165+ contents <> inTags False "a" [("href", "#fnref" ++ ref),
166+ ("class", "footnoteBacklink"),
167+ ("title", "Jump back to footnote " ++ ref)]
168+ (text "&#8617;")
169+blockToHtml opts (Key _ _) = empty
170+blockToHtml opts (CodeBlock str) =
171+ text "<pre><code>" <> text (escapeSGML str) <> text "\n</code></pre>"
172+blockToHtml opts (RawHtml str) = text str
173+blockToHtml opts (BulletList lst) =
174+ let attribs = if (writerIncremental opts)
175+ then [("class","incremental")]
176+ else [] in
177+ inTags True "ul" attribs $ vcat $ map (listItemToHtml opts) lst
178+blockToHtml opts (OrderedList lst) =
179+ let attribs = if (writerIncremental opts)
180+ then [("class","incremental")]
181+ else [] in
182+ inTags True "ol" attribs $ vcat $ map (listItemToHtml opts) lst
183+blockToHtml opts HorizontalRule = selfClosingTag "hr" []
184+blockToHtml opts (Header level lst) =
185+ let contents = wrap opts lst in
179186 if ((level > 0) && (level <= 6))
180− then "<h" ++ (show level) ++ ">" ++ contents ++
181− "</h" ++ (show level) ++ ">\n"
182− else "<p>" ++ contents ++ "</p>\n"
183−listItemToHtml options list =
184− "<li>" ++ (concatMap (blockToHtml options) list) ++ "</li>\n"
187+ then inTagsSimple ("h" ++ show level) contents
188+ else inTagsSimple "p" contents
189+
190+listItemToHtml :: WriterOptions -> [Block] -> Doc
191+listItemToHtml opts list =
192+ inTagsSimple "li" $ vcat $ map (blockToHtml opts) list
185193
186194-- | Convert list of Pandoc inline elements to HTML.
187−inlineListToHtml :: WriterOptions -> [Inline] -> String
188−inlineListToHtml options lst =
189− -- consolidate adjacent Str and Space elements for more intelligent
190− -- smart typography filtering
191− let lst' = consolidateList lst in
192− concatMap (inlineToHtml options) lst'
195+inlineListToHtml :: WriterOptions -> [Inline] -> Doc
196+inlineListToHtml opts lst = hcat (map (inlineToHtml opts) lst)
193197
194198-- | Convert Pandoc inline element to HTML.
195−inlineToHtml :: WriterOptions -> Inline -> String
196−inlineToHtml options (Emph lst) =
197− "<em>" ++ (inlineListToHtml options lst) ++ "</em>"
198−inlineToHtml options (Strong lst) =
199− "<strong>" ++ (inlineListToHtml options lst) ++ "</strong>"
200−inlineToHtml options (Code str) =
201− "<code>" ++ (escapeSGML str) ++ "</code>"
202−inlineToHtml options (Str str) = stringToSGML options str
203−inlineToHtml options (TeX str) = (escapeSGML str)
204−inlineToHtml options (HtmlInline str) = str
205−inlineToHtml options (LineBreak) = "<br />\n"
206−inlineToHtml options Space = " "
207−inlineToHtml options (Link text (Src src tit)) =
208− let title = stringToSGML options tit in
199+inlineToHtml :: WriterOptions -> Inline -> Doc
200+inlineToHtml opts (Emph lst) =
201+ inTagsSimple "em" (inlineListToHtml opts lst)
202+inlineToHtml opts (Strong lst) =
203+ inTagsSimple "strong" (inlineListToHtml opts lst)
204+inlineToHtml opts (Code str) =
205+ inTagsSimple "code" $ text (escapeSGML str)
206+inlineToHtml opts (Quoted SingleQuote lst) =
207+ text "&lsquo;" <> (inlineListToHtml opts lst) <> text "&rsquo;"
208+inlineToHtml opts (Quoted DoubleQuote lst) =
209+ text "&ldquo;" <> (inlineListToHtml opts lst) <> text "&rdquo;"
210+inlineToHtml opts EmDash = text "&mdash;"
211+inlineToHtml opts EnDash = text "&ndash;"
212+inlineToHtml opts Ellipses = text "&hellip;"
213+inlineToHtml opts Apostrophe = text "&rsquo;"
214+inlineToHtml opts (Str str) = text $ stringToSGML str
215+inlineToHtml opts (TeX str) = text $ escapeSGML str
216+inlineToHtml opts (HtmlInline str) = text str
217+inlineToHtml opts (LineBreak) = selfClosingTag "br" []
218+inlineToHtml opts Space = space
219+inlineToHtml opts (Link txt (Src src tit)) =
220+ let title = stringToSGML tit in
209221 if (isPrefixOf "mailto:" src)
210− then obfuscateLink options text src
211− else "<a href=\"" ++ (escapeSGML src) ++ "\"" ++
212− (if tit /= "" then " title=\"" ++ title ++ "\">" else ">") ++
213− (inlineListToHtml options text) ++ "</a>"
214−inlineToHtml options (Link text (Ref ref)) =
215− "[" ++ (inlineListToHtml options text) ++ "][" ++
216− (inlineListToHtml options ref) ++ "]"
222+ then obfuscateLink opts txt src
223+ else inTags False "a" ([("href", escapeSGML src)] ++
224+ if null tit then [] else [("title", title)])
225+ (inlineListToHtml opts txt)
226+inlineToHtml opts (Link txt (Ref ref)) =
227+ char '[' <> (inlineListToHtml opts txt) <> text "][" <>
228+ (inlineListToHtml opts ref) <> char ']'
217229 -- this is what markdown does, for better or worse
218−inlineToHtml options (Image alt (Src source tit)) =
219− let title = stringToSGML options tit
220− alternate = inlineListToHtml options alt in
221− "<img src=\"" ++ source ++ "\"" ++
222− (if tit /= "" then " title=\"" ++ title ++ "\"" else "") ++
223− (if alternate /= "" then " alt=\"" ++ alternate ++ "\"" else "") ++ ">"
224−inlineToHtml options (Image alternate (Ref ref)) =
225− "![" ++ (inlineListToHtml options alternate) ++ "][" ++
226− (inlineListToHtml options ref) ++ "]"
227−inlineToHtml options (NoteRef ref) =
228− "<sup class=\"footnoteRef\" id=\"fnref" ++ ref ++ "\"><a href=\"#fn" ++
229− ref ++ "\">" ++ ref ++ "</a></sup>"
230+inlineToHtml opts (Image alt (Src source tit)) =
231+ let title = stringToSGML tit
232+ alternate = render $ inlineListToHtml opts alt in
233+ selfClosingTag "img" $ [("src", source)] ++
234+ (if null tit then [] else [("title", title)]) ++
235+ (if null alternate then [] else [("alt", alternate)])
236+inlineToHtml opts (Image alternate (Ref ref)) =
237+ text "![" <> (inlineListToHtml opts alternate) <> text "][" <>
238+ (inlineListToHtml opts ref) <> char ']'
239+inlineToHtml opts (NoteRef ref) =
240+ inTags False "sup" [("class", "footnoteRef"), ("id", "fnref" ++ ref)]
241+ (inTags False "a" [("href", "#fn" ++ ref)] $ text ref)
src/Text/Pandoc/Writers/LaTeX.hs+11−32
@@ -84,36 +84,9 @@ escapeBar = gsub "\\|" "\\\\textbar{}"
8484escapeLt = gsub "<" "\\\\textless{}"
8585escapeGt = gsub ">" "\\\\textgreater{}"
8686
87−escapeDoubleQuotes =
88− gsub "\"" "''" . -- rest are right quotes .
89− gsub "``\\\\footnote" "''\\\\footnote" . -- except \footnote
90− gsub "\"\\\\" "``\\\\" . -- left quote before latex command
91− gsub "([[:space:]])\"" "\\1``" . -- never right quote after space
92− gsub "\"('|`)([^[:punct:][:space:]])" "``{}`\\2" . -- "'word left
93− gsub "\"([^[:punct:][:space:]])" "``\\1" -- "word left
94−
95−escapeSingleQuotes =
96− gsub "`\\\\footnote" "'\\\\footnote" . -- except \footnote
97− gsub "'\\\\" "`\\\\" . -- left quote before latex command
98− gsub "('|`)(\"|``)" "`{}``" . -- '"word left
99− gsub "([^[:punct:][:space:]])`(s|S)" "\\1'\\2" . -- catch possessives
100− gsub "^'([^[:punct:][:space:]])" "`\\1" . -- 'word left
101− gsub "([[:space:]])'" "\\1`" . -- never right quote after space
102− gsub "([[:space:]])'([^[:punct:][:space:]])" "\\1`\\2"
103− -- 'word left (leave possessives)
104−
105−escapeEllipses = gsub "\\.\\.\\.|\\. \\. \\." "\\ldots{}"
106−
107−escapeDashes = gsub "([0-9])-([0-9])" "\\1--\\2" .
108− gsub " *--- *" "---" .
109− gsub "([^-])--([^-])" "\\1---\\2"
110−
111−escapeSmart = escapeDashes . escapeSingleQuotes . escapeDoubleQuotes .
112− escapeEllipses
113−
114−-- | Escape string for LaTeX (including smart quotes, dashes, ellipses)
87+-- | Escape string for LaTeX
11588stringToLaTeX :: String -> String
116−stringToLaTeX = escapeSmart . escapeGt . escapeLt . escapeBar . escapeHat .
89+stringToLaTeX = escapeGt . escapeLt . escapeBar . escapeHat .
11790 escapeSpecial . fixBackslash . escapeBrackets .
11891 escapeBackslash
11992
@@ -158,9 +131,7 @@ inlineListToLaTeX :: [Block] -- ^ List of note blocks to use in resolving note
158131 -> [Inline] -- ^ Inlines to convert
159132 -> String
160133inlineListToLaTeX notes lst =
161− -- first, consolidate Str and Space for more effective smartquotes:
162− let lst' = consolidateList lst in
163− concatMap (inlineToLaTeX notes) lst'
134+ concatMap (inlineToLaTeX notes) lst
164135
165136-- | Convert inline element to LaTeX
166137inlineToLaTeX :: [Block] -- ^ List of note blocks to use in resolving note refs
@@ -173,6 +144,14 @@ inlineToLaTeX notes (Strong lst) = "\\textbf{" ++
173144inlineToLaTeX notes (Code str) = "\\verb" ++ [chr] ++ stuffing ++ [chr]
174145 where stuffing = str
175146 chr = ((enumFromTo '!' '~') \\ stuffing) !! 0
147+inlineToLaTeX notes (Quoted SingleQuote lst) =
148+ "`" ++ inlineListToLaTeX notes lst ++ "'"
149+inlineToLaTeX notes (Quoted DoubleQuote lst) =
150+ "``" ++ inlineListToLaTeX notes lst ++ "''"
151+inlineToLaTeX notes Apostrophe = "'"
152+inlineToLaTeX notes EmDash = "---"
153+inlineToLaTeX notes EnDash = "--"
154+inlineToLaTeX notes Ellipses = "\\ldots{}"
176155inlineToLaTeX notes (Str str) = stringToLaTeX str
177156inlineToLaTeX notes (TeX str) = str
178157inlineToLaTeX notes (HtmlInline str) = ""
src/Text/Pandoc/Writers/Markdown.hs+17−6
@@ -35,6 +35,7 @@ module Text.Pandoc.Writers.Markdown (
3535import Text.Regex ( matchRegex, mkRegex )
3636import Text.Pandoc.Definition
3737import Text.Pandoc.Shared
38+import Data.List ( group )
3839import Text.PrettyPrint.HughesPJ hiding ( Str )
3940
4041-- | Convert Pandoc to Markdown.
@@ -154,12 +155,22 @@ inlineToMarkdown (Emph lst) = text "*" <>
154155 (inlineListToMarkdown lst) <> text "*"
155156inlineToMarkdown (Strong lst) = text "**" <>
156157 (inlineListToMarkdown lst) <> text "**"
157−inlineToMarkdown (Code str) =
158− case (matchRegex (mkRegex "``") str) of
159− Just match -> text ("` " ++ str ++ " `")
160− Nothing -> case (matchRegex (mkRegex "`") str) of
161− Just match -> text ("`` " ++ str ++ " ``")
162− Nothing -> text ("`" ++ str ++ "`")
158+inlineToMarkdown (Quoted SingleQuote lst) = char '\'' <>
159+ (inlineListToMarkdown lst) <> char '\''
160+inlineToMarkdown (Quoted DoubleQuote lst) = char '"' <>
161+ (inlineListToMarkdown lst) <> char '"'
162+inlineToMarkdown EmDash = text "--"
163+inlineToMarkdown EnDash = char '-'
164+inlineToMarkdown Apostrophe = char '\''
165+inlineToMarkdown Ellipses = text "..."
166+inlineToMarkdown (Code str) =
167+ let tickGroups = filter (\s -> '`' `elem` s) $ group str
168+ longest = if null tickGroups
169+ then 0
170+ else maximum $ map length tickGroups
171+ marker = replicate (longest + 1) '`'
172+ spacer = if (longest == 0) then "" else " " in
173+ text (marker ++ spacer ++ str ++ spacer ++ marker)
163174inlineToMarkdown (Str str) = text $ escapeString str
164175inlineToMarkdown (TeX str) = text str
165176inlineToMarkdown (HtmlInline str) = text str
src/Text/Pandoc/Writers/RST.hs+8
@@ -182,6 +182,14 @@ inlineToRST (Emph lst) = let (main, refs) = inlineListToRST lst in
182182 (text "*" <> main <> text "*", refs)
183183inlineToRST (Strong lst) = let (main, refs) = inlineListToRST lst in
184184 (text "**" <> main <> text "**", refs)
185+inlineToRST (Quoted SingleQuote lst) = let (main, refs) = inlineListToRST lst in
186+ (char '\'' <> main <> char '\'', refs)
187+inlineToRST (Quoted DoubleQuote lst) = let (main, refs) = inlineListToRST lst in
188+ (char '"' <> main <> char '"', refs)
189+inlineToRST EmDash = (text "--", empty)
190+inlineToRST EnDash = (char '-', empty)
191+inlineToRST Apostrophe = (char '\'', empty)
192+inlineToRST Ellipses = (text "...", empty)
185193inlineToRST (Code str) = (text $ "``" ++ str ++ "``", empty)
186194inlineToRST (Str str) = (text $ escapeString str, empty)
187195inlineToRST (TeX str) = (text str, empty)
src/Text/Pandoc/Writers/RTF.hs+8
@@ -211,6 +211,14 @@ inlineToRTF :: [Block] -- ^ list of note blocks
211211inlineToRTF notes (Emph lst) = "{\\i " ++ (inlineListToRTF notes lst) ++ "} "
212212inlineToRTF notes (Strong lst) =
213213 "{\\b " ++ (inlineListToRTF notes lst) ++ "} "
214+inlineToRTF notes (Quoted SingleQuote lst) =
215+ "\\u8216'" ++ (inlineListToRTF notes lst) ++ "\\u8217'"
216+inlineToRTF notes (Quoted DoubleQuote lst) =
217+ "\\u8220\"" ++ (inlineListToRTF notes lst) ++ "\\u8221\""
218+inlineToRTF notes Apostrophe = "\\u8217'"
219+inlineToRTF notes Ellipses = "\\u8230?"
220+inlineToRTF notes EmDash = "\\u8212-"
221+inlineToRTF notes EnDash = "\\u8211-"
214222inlineToRTF notes (Code str) = "{\\f1 " ++ (codeStringToRTF str) ++ "} "
215223inlineToRTF notes (Str str) = stringToRTF str
216224inlineToRTF notes (TeX str) = latexToRTF str
tests/generate.sh−1
@@ -4,7 +4,6 @@
44../pandoc -r native -s -w markdown testsuite.native > writer.markdown
55../pandoc -r native -s -w rst testsuite.native > writer.rst
66../pandoc -r native -s -w html testsuite.native > writer.html
7−../pandoc -r native -s -w html -S testsuite.native > writer.smart.html
87../pandoc -r native -s -w latex testsuite.native > writer.latex
98../pandoc -r native -s -w rtf testsuite.native > writer.rtf
109sed -e '/^, Header 1 \[Str "HTML",Space,Str "Blocks"\]/,/^, HorizontalRule/d' testsuite.native | ../pandoc -r native -w docbook -s > writer.docbook
tests/runtests.pl+3−3
@@ -14,7 +14,7 @@ unless (-x $script) { die "$script is not executable.\n"; }
1414
1515print "Writer tests:\n";
1616
17−my @writeformats = ("html", "smart.html", "latex", "rst", "rtf", "markdown", "native"); # s5 separately
17+my @writeformats = ("html", "latex", "rst", "rtf", "markdown", "native"); # s5 separately
1818my @readformats = ("latex", "native"); # handle html,markdown & rst separately
1919my $source = "testsuite.native";
2020
@@ -62,7 +62,7 @@ print "Testing s5 writer (basic)...";
6262test_results("s5 writer (basic)", "tmp.html", "s5.basic.html");
6363
6464print "Testing s5 writer (fancy)...";
65−`$script -r native -w s5 -s -S -m -i s5.native > tmp.html`;
65+`$script -r native -w s5 -s -m -i s5.native > tmp.html`;
6666test_results("s5 writer (fancy)", "tmp.html", "s5.fancy.html");
6767
6868print "Testing html fragment...";
@@ -76,7 +76,7 @@ test_results("-B, -A, -H, -c options", "tmp.html", "s5.inserts.html");
7676print "\nReader tests:\n";
7777
7878print "Testing markdown reader...";
79−`$script -r markdown -w native -s testsuite.txt > tmp.native`;
79+`$script -r markdown -w native -s -S testsuite.txt > tmp.native`;
8080test_results("markdown reader", "tmp.native", "testsuite.native");
8181
8282print "Testing rst reader...";
tests/s5.basic.html+14−11
@@ -737,6 +737,7 @@ function startup() {
737737
738738window.onload = startup;
739739window.onresize = function(){setTimeout('fontScale()', 50);}</script>
740+
740741<meta name="author" content="Sam Smith, Jen Jones" />
741742<meta name="date" content="July 15, 2006" />
742743<title>My S5 Document</title>
@@ -747,38 +748,40 @@ window.onresize = function(){setTimeout('fontScale()', 50);}</script>
747748<div id="currentSlide"></div>
748749<div id="header"></div>
749750<div id="footer">
751+
750752<h1>July 15, 2006</h1>
751753<h2>My S5 Document</h2>
752754</div>
753755</div>
756+
754757<div class="presentation">
755758
759+
756760<div class="slide">
761+
757762<h1>My S5 Document</h1>
758763<h3>Sam Smith, Jen Jones</h3>
759764<h4>July 15, 2006</h4>
760765</div>
766+
761767<div class="slide">
768+
762769<h1>First slide</h1>
763770<ul>
764−<li>first bullet</li>
765−<li>second bullet</li>
766−</ul>
767−</div>
768−<div class="slide">
769−<h1>Smarty</h1>
770−<ul class="incremental">
771−<li>&quot;Hello there&quot;</li>
772−<li>Here's a -- dash</li>
773−<li>And 'ellipses'...</li>
771+ <li>first bullet</li>
772+ <li>second bullet</li>
774773</ul>
775774</div>
775+
776776<div class="slide">
777+
777778<h1>Math</h1>
778779<ul>
779−<li>$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</li>
780+ <li>$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</li>
780781</ul>
781782</div>
783+
782784</div>
785+
783786</body>
784787</html>
tests/s5.fancy.html+14−11
@@ -1649,6 +1649,7 @@ else
16491649 }
16501650}
16511651</script>
1652+
16521653<meta name="author" content="Sam Smith, Jen Jones" />
16531654<meta name="date" content="July 15, 2006" />
16541655<title>My S5 Document</title>
@@ -1659,38 +1660,40 @@ else
16591660<div id="currentSlide"></div>
16601661<div id="header"></div>
16611662<div id="footer">
1663+
16621664<h1>July 15, 2006</h1>
16631665<h2>My S5 Document</h2>
16641666</div>
16651667</div>
1668+
16661669<div class="presentation">
16671670
1671+
16681672<div class="slide">
1673+
16691674<h1>My S5 Document</h1>
16701675<h3>Sam Smith, Jen Jones</h3>
16711676<h4>July 15, 2006</h4>
16721677</div>
1678+
16731679<div class="slide">
1680+
16741681<h1>First slide</h1>
16751682<ul class="incremental">
1676−<li>first bullet</li>
1677−<li>second bullet</li>
1678−</ul>
1679−</div>
1680−<div class="slide">
1681−<h1>Smarty</h1>
1682−<ul>
1683−<li>&ldquo;Hello there&rdquo;</li>
1684−<li>Here&rsquo;s a&mdash;dash</li>
1685−<li>And &lsquo;ellipses&rsquo;&hellip;</li>
1683+ <li>first bullet</li>
1684+ <li>second bullet</li>
16861685</ul>
16871686</div>
1687+
16881688<div class="slide">
1689+
16891690<h1>Math</h1>
16901691<ul class="incremental">
1691−<li>$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</li>
1692+ <li>$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</li>
16921693</ul>
16931694</div>
1695+
16941696</div>
1697+
16951698</body>
16961699</html>
tests/s5.fragment.html+3−11
@@ -1,17 +1,9 @@
11<h1>First slide</h1>
22<ul>
3−<li>first bullet</li>
4−<li>second bullet</li>
3+ <li>first bullet</li>
4+ <li>second bullet</li>
55</ul>
6−<h1>Smarty</h1>
7−<blockquote>
8−<ul>
9−<li>&quot;Hello there&quot;</li>
10−<li>Here's a -- dash</li>
11−<li>And 'ellipses'...</li>
12−</ul>
13−</blockquote>
146<h1>Math</h1>
157<ul>
16−<li>$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</li>
8+ <li>$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</li>
179</ul>
tests/s5.inserts.html+9−12
@@ -6,30 +6,27 @@
66<meta name="generator" content="pandoc" />
77<link rel="stylesheet" href="main.css" type="text/css" media="all" />
88STUFF INSERTED
9+
910<meta name="author" content="Sam Smith, Jen Jones" />
1011<meta name="date" content="July 15, 2006" />
1112<title>My S5 Document</title>
1213</head>
1314<body>
1415STUFF INSERTED
15−<h1 class="title">My S5 Document</h1>
16+
17+<h1 class="title">
18+My S5 Document
19+</h1>
1620<h1>First slide</h1>
1721<ul>
18−<li>first bullet</li>
19−<li>second bullet</li>
22+ <li>first bullet</li>
23+ <li>second bullet</li>
2024</ul>
21−<h1>Smarty</h1>
22−<blockquote>
23−<ul>
24−<li>&quot;Hello there&quot;</li>
25−<li>Here's a -- dash</li>
26−<li>And 'ellipses'...</li>
27−</ul>
28−</blockquote>
2925<h1>Math</h1>
3026<ul>
31−<li>$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</li>
27+ <li>$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</li>
3228</ul>
3329STUFF INSERTED
30+
3431</body>
3532</html>
tests/s5.native−6
@@ -3,12 +3,6 @@ Pandoc (Meta [Str "My",Space,Str "S5",Space,Str "Document"] ["Sam Smith","Jen Jo
33, BulletList
44 [ [ Plain [Str "first",Space,Str "bullet"] ]
55 , [ Plain [Str "second",Space,Str "bullet"] ] ]
6−, Header 1 [Str "Smarty"]
7−, BlockQuote
8− [ BulletList
9− [ [ Plain [Str "\"Hello",Space,Str "there\""] ]
10− , [ Plain [Str "Here's",Space,Str "a",Space,Str "--",Space,Str "dash"] ]
11− , [ Plain [Str "And",Space,Str "'ellipses'..."] ] ] ]
126, Header 1 [Str "Math"]
137, BulletList
148 [ [ Plain [TeX "$\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}$"] ]
tests/testsuite.native+57−57
@@ -1,5 +1,5 @@
11Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane","Anonymous"] "July 17, 2006")
2−[ Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "set",Space,Str "of",Space,Str "tests",Space,Str "for",Space,Str "pandoc.",Space,Str "Most",Space,Str "of",Space,Str "them",Space,Str "are",Space,Str "adapted",Space,Str "from",Space,Str "John",Space,Str "Gruber's",Space,Str "markdown",Space,Str "test",Space,Str "suite."]
2+[ Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "set",Space,Str "of",Space,Str "tests",Space,Str "for",Space,Str "pandoc",Str ".",Space,Str "Most",Space,Str "of",Space,Str "them",Space,Str "are",Space,Str "adapted",Space,Str "from",Space,Str "John",Space,Str "Gruber",Apostrophe,Str "s",Space,Str "markdown",Space,Str "test",Space,Str "suite",Str "."]
33, HorizontalRule
44, Header 1 [Str "Headers"]
55, Header 2 [Str "Level",Space,Str "2",Space,Str "with",Space,Str "an",Space,Link [Str "embedded",Space,Str "link"] (Src "/url" "")]
@@ -14,15 +14,15 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
1414, Para [Str "with",Space,Str "no",Space,Str "blank",Space,Str "line"]
1515, HorizontalRule
1616, Header 1 [Str "Paragraphs"]
17−, Para [Str "Here's",Space,Str "a",Space,Str "regular",Space,Str "paragraph."]
18−, Para [Str "In",Space,Str "Markdown",Space,Str "1.0.0",Space,Str "and",Space,Str "earlier.",Space,Str "Version",Space,Str "8.",Space,Str "This",Space,Str "line",Space,Str "turns",Space,Str "into",Space,Str "a",Space,Str "list",Space,Str "item.",Space,Str "Because",Space,Str "a",Space,Str "hard",Str "-",Str "wrapped",Space,Str "line",Space,Str "in",Space,Str "the",Space,Str "middle",Space,Str "of",Space,Str "a",Space,Str "paragraph",Space,Str "looked",Space,Str "like",Space,Str "a",Space,Str "list",Space,Str "item."]
19−, Para [Str "Here's",Space,Str "one",Space,Str "with",Space,Str "a",Space,Str "bullet.",Space,Str "*",Space,Str "criminey."]
20−, Para [Str "There",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "hard",Space,Str "line",Space,Str "break",LineBreak,Str "here."]
17+, Para [Str "Here",Apostrophe,Str "s",Space,Str "a",Space,Str "regular",Space,Str "paragraph",Str "."]
18+, Para [Str "In",Space,Str "Markdown",Space,Str "1",Str ".",Str "0",Str ".",Str "0",Space,Str "and",Space,Str "earlier",Str ".",Space,Str "Version",Space,Str "8",Str ".",Space,Str "This",Space,Str "line",Space,Str "turns",Space,Str "into",Space,Str "a",Space,Str "list",Space,Str "item",Str ".",Space,Str "Because",Space,Str "a",Space,Str "hard",Str "-",Str "wrapped",Space,Str "line",Space,Str "in",Space,Str "the",Space,Str "middle",Space,Str "of",Space,Str "a",Space,Str "paragraph",Space,Str "looked",Space,Str "like",Space,Str "a",Space,Str "list",Space,Str "item",Str "."]
19+, Para [Str "Here",Apostrophe,Str "s",Space,Str "one",Space,Str "with",Space,Str "a",Space,Str "bullet",Str ".",Space,Str "*",Space,Str "criminey",Str "."]
20+, Para [Str "There",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "hard",Space,Str "line",Space,Str "break",LineBreak,Str "here",Str "."]
2121, HorizontalRule
2222, Header 1 [Str "Block",Space,Str "Quotes"]
2323, Para [Str "E",Str "-",Str "mail",Space,Str "style:"]
2424, BlockQuote
25− [ Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "block",Space,Str "quote.",Space,Str "It",Space,Str "is",Space,Str "pretty",Space,Str "short."] ]
25+ [ Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "block",Space,Str "quote",Str ".",Space,Str "It",Space,Str "is",Space,Str "pretty",Space,Str "short",Str "."] ]
2626
2727, BlockQuote
2828 [ Para [Str "Code",Space,Str "in",Space,Str "a",Space,Str "block",Space,Str "quote:"]
@@ -38,7 +38,7 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
3838 , BlockQuote
3939 [ Para [Str "nested"] ]
4040 ]
41−, Para [Str "This",Space,Str "should",Space,Str "not",Space,Str "be",Space,Str "a",Space,Str "block",Space,Str "quote:",Space,Str "2",Space,Str ">",Space,Str "1."]
41+, Para [Str "This",Space,Str "should",Space,Str "not",Space,Str "be",Space,Str "a",Space,Str "block",Space,Str "quote:",Space,Str "2",Space,Str ">",Space,Str "1",Str "."]
4242, Para [Str "Box",Str "-",Str "style:"]
4343, BlockQuote
4444 [ Para [Str "Example:"]
@@ -47,13 +47,13 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
4747 [ OrderedList
4848 [ [ Plain [Str "do",Space,Str "laundry"] ]
4949 , [ Plain [Str "take",Space,Str "out",Space,Str "the",Space,Str "trash"] ] ] ]
50−, Para [Str "Here's",Space,Str "a",Space,Str "nested",Space,Str "one:"]
50+, Para [Str "Here",Apostrophe,Str "s",Space,Str "a",Space,Str "nested",Space,Str "one:"]
5151, BlockQuote
5252 [ Para [Str "Joe",Space,Str "said:"]
5353 , BlockQuote
54− [ Para [Str "Don't",Space,Str "quote",Space,Str "me."] ]
54+ [ Para [Str "Don",Apostrophe,Str "t",Space,Str "quote",Space,Str "me",Str "."] ]
5555 ]
56−, Para [Str "And",Space,Str "a",Space,Str "following",Space,Str "paragraph."]
56+, Para [Str "And",Space,Str "a",Space,Str "following",Space,Str "paragraph",Str "."]
5757, HorizontalRule
5858, Header 1 [Str "Code",Space,Str "Blocks"]
5959, Para [Str "Code:"]
@@ -116,9 +116,9 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
116116 , [ Para [Str "Three"] ] ]
117117, Para [Str "Multiple",Space,Str "paragraphs:"]
118118, OrderedList
119− [ [ Para [Str "Item",Space,Str "1,",Space,Str "graf",Space,Str "one."]
120− , Para [Str "Item",Space,Str "1.",Space,Str "graf",Space,Str "two.",Space,Str "The",Space,Str "quick",Space,Str "brown",Space,Str "fox",Space,Str "jumped",Space,Str "over",Space,Str "the",Space,Str "lazy",Space,Str "dog's",Space,Str "back."] ], [ Para [Str "Item",Space,Str "2."] ]
121− , [ Para [Str "Item",Space,Str "3."] ] ]
119+ [ [ Para [Str "Item",Space,Str "1,",Space,Str "graf",Space,Str "one",Str "."]
120+ , Para [Str "Item",Space,Str "1",Str ".",Space,Str "graf",Space,Str "two",Str ".",Space,Str "The",Space,Str "quick",Space,Str "brown",Space,Str "fox",Space,Str "jumped",Space,Str "over",Space,Str "the",Space,Str "lazy",Space,Str "dog",Apostrophe,Str "s",Space,Str "back",Str "."] ], [ Para [Str "Item",Space,Str "2",Str "."] ]
121+ , [ Para [Str "Item",Space,Str "3",Str "."] ] ]
122122, Header 2 [Str "Nested"]
123123, BulletList
124124 [ [ Plain [Str "Tab"]
@@ -127,7 +127,7 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
127127 , BulletList
128128 [ [ Plain [Str "Tab"] ]
129129 ] ] ] ] ]
130−, Para [Str "Here's",Space,Str "another:"]
130+, Para [Str "Here",Apostrophe,Str "s",Space,Str "another:"]
131131, OrderedList
132132 [ [ Plain [Str "First"] ]
133133 , [ Plain [Str "Second:"]
@@ -168,7 +168,7 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
168168, RawHtml "</td>\n<td>"
169169, Plain [Str "And",Space,Str "this",Space,Str "is",Space,Strong [Str "strong"]]
170170, RawHtml "</td>\n</tr>\n</table>\n\n<script type=\"text/javascript\">document.write('This *should not* be interpreted as markdown');</script>\n"
171−, Para [Str "Here's",Space,Str "a",Space,Str "simple",Space,Str "block:"]
171+, Para [Str "Here",Apostrophe,Str "s",Space,Str "a",Space,Str "simple",Space,Str "block:"]
172172, RawHtml "<div>\n "
173173, Plain [Str "foo"]
174174, RawHtml "</div>\n"
@@ -190,28 +190,28 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
190190, RawHtml "<!-- foo --> \n"
191191, Para [Str "Code:"]
192192, CodeBlock "<hr />"
193−, Para [Str "Hr's:"]
193+, Para [Str "Hr",Apostrophe,Str "s:"]
194194, RawHtml "<hr>\n\n<hr />\n\n<hr />\n\n<hr> \n\n<hr /> \n\n<hr /> \n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\">\n"
195195, HorizontalRule
196196, Header 1 [Str "Inline",Space,Str "Markup"]
197197, Para [Str "This",Space,Str "is",Space,Emph [Str "emphasized"],Str ",",Space,Str "and",Space,Str "so",Space,Emph [Str "is",Space,Str "this"],Str "."]
198198, Para [Str "This",Space,Str "is",Space,Strong [Str "strong"],Str ",",Space,Str "and",Space,Str "so",Space,Strong [Str "is",Space,Str "this"],Str "."]
199199, Para [Str "An",Space,Emph [Link [Str "emphasized",Space,Str "link"] (Src "/url" "")],Str "."]
200−, Para [Strong [Emph [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em."]]]
201−, Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word."]
202−, Para [Strong [Emph [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em."]]]
203−, Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word."]
200+, Para [Strong [Emph [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em",Str "."]]]
201+, Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word",Str "."]
202+, Para [Strong [Emph [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em",Str "."]]]
203+, Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word",Str "."]
204204, Para [Str "This",Space,Str "is",Space,Str "code:",Space,Code ">",Str ",",Space,Code "$",Str ",",Space,Code "\\",Str ",",Space,Code "\\$",Str ",",Space,Code "<html>",Str "."]
205205, HorizontalRule
206206, Header 1 [Str "Smart",Space,Str "quotes,",Space,Str "ellipses,",Space,Str "dashes"]
207−, Para [Str "\"Hello,\"",Space,Str "said",Space,Str "the",Space,Str "spider.",Space,Str "\"'Shelob'",Space,Str "is",Space,Str "my",Space,Str "name.\""]
208−, Para [Str "'A',",Space,Str "'B',",Space,Str "and",Space,Str "'C'",Space,Str "are",Space,Str "letters."]
209−, Para [Str "'Oak,'",Space,Str "'elm,'",Space,Str "and",Space,Str "'beech'",Space,Str "are",Space,Str "names",Space,Str "of",Space,Str "trees.",Space,Str "So",Space,Str "is",Space,Str "'pine.'"]
210−, Para [Str "'He",Space,Str "said,",Space,Str "\"I",Space,Str "want",Space,Str "to",Space,Str "go.\"'",Space,Str "Were",Space,Str "you",Space,Str "alive",Space,Str "in",Space,Str "the",Space,Str "70's?"]
211−, Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "quoted",Space,Str "'",Code "code",Str "'",Space,Str "and",Space,Str "a",Space,Str "\"",Link [Str "quoted",Space,Str "link"] (Ref [Str "1"]),Str "\"."]
212−, Para [Str "Some",Space,Str "dashes:",Space,Str "one",Str "---",Str "two",Space,Str "---",Space,Str "three",Str "--",Str "four",Space,Str "--",Space,Str "five."]
213−, Para [Str "Dashes",Space,Str "between",Space,Str "numbers:",Space,Str "5",Str "-",Str "7,",Space,Str "255",Str "-",Str "66,",Space,Str "1987",Str "-",Str "1999."]
214−, Para [Str "Ellipses...and.",Space,Str ".",Space,Str ".and",Space,Str ".",Space,Str ".",Space,Str ".",Space,Str "."]
207+, Para [Quoted DoubleQuote [Str "Hello,"],Space,Str "said",Space,Str "the",Space,Str "spider",Str ".",Space,Quoted DoubleQuote [Quoted SingleQuote [Str "Shelob"],Space,Str "is",Space,Str "my",Space,Str "name",Str "."]]
208+, Para [Quoted SingleQuote [Str "A"],Str ",",Space,Quoted SingleQuote [Str "B"],Str ",",Space,Str "and",Space,Quoted SingleQuote [Str "C"],Space,Str "are",Space,Str "letters",Str "."]
209+, Para [Quoted SingleQuote [Str "Oak,"],Space,Quoted SingleQuote [Str "elm,"],Space,Str "and",Space,Quoted SingleQuote [Str "beech"],Space,Str "are",Space,Str "names",Space,Str "of",Space,Str "trees",Str ".",Space,Str "So",Space,Str "is",Space,Quoted SingleQuote [Str "pine",Str "."]]
210+, Para [Quoted SingleQuote [Str "He",Space,Str "said,",Space,Quoted DoubleQuote [Str "I",Space,Str "want",Space,Str "to",Space,Str "go",Str "."]],Space,Str "Were",Space,Str "you",Space,Str "alive",Space,Str "in",Space,Str "the",Space,Str "70",Apostrophe,Str "s?"]
211+, Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "quoted",Space,Quoted SingleQuote [Code "code"],Space,Str "and",Space,Str "a",Space,Quoted DoubleQuote [Link [Str "quoted",Space,Str "link"] (Ref [Str "1"])],Str "."]
212+, Para [Str "Some",Space,Str "dashes:",Space,Str "one",EmDash,Str "two",EmDash,Str "three",EmDash,Str "four",EmDash,Str "five",Str "."]
213+, Para [Str "Dashes",Space,Str "between",Space,Str "numbers:",Space,Str "5",EnDash,Str "7,",Space,Str "255",EnDash,Str "66,",Space,Str "1987",EnDash,Str "1999",Str "."]
214+, Para [Str "Ellipses",Ellipses,Str "and",Ellipses,Str "and",Ellipses,Str "."]
215215, HorizontalRule
216216, Header 1 [Str "LaTeX"]
217217, BulletList
@@ -223,13 +223,13 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
223223 , [ Plain [TeX "$223$"] ]
224224 , [ Plain [TeX "$p$",Str "-",Str "Tree"] ]
225225 , [ Plain [TeX "$\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}$"] ]
226− , [ Plain [Str "Here's",Space,Str "one",Space,Str "that",Space,Str "has",Space,Str "a",Space,Str "line",Space,Str "break",Space,Str "in",Space,Str "it:",Space,TeX "$\\alpha + \\omega \\times x^2$",Str "."] ] ]
227−, Para [Str "These",Space,Str "shouldn't",Space,Str "be",Space,Str "math:"]
226+ , [ Plain [Str "Here",Apostrophe,Str "s",Space,Str "one",Space,Str "that",Space,Str "has",Space,Str "a",Space,Str "line",Space,Str "break",Space,Str "in",Space,Str "it:",Space,TeX "$\\alpha + \\omega \\times x^2$",Str "."] ] ]
227+, Para [Str "These",Space,Str "shouldn",Apostrophe,Str "t",Space,Str "be",Space,Str "math:"]
228228, BulletList
229229 [ [ Plain [Str "To",Space,Str "get",Space,Str "the",Space,Str "famous",Space,Str "equation,",Space,Str "write",Space,Code "$e = mc^2$",Str "."] ]
230− , [ Plain [Str "$",Str "22,000",Space,Str "is",Space,Str "a",Space,Emph [Str "lot"],Space,Str "of",Space,Str "money.",Space,Str "So",Space,Str "is",Space,Str "$",Str "34,000.",Space,Str "(It",Space,Str "worked",Space,Str "if",Space,Str "\"lot\"",Space,Str "is",Space,Str "emphasized.)"] ]
230+ , [ Plain [Str "$",Str "22,000",Space,Str "is",Space,Str "a",Space,Emph [Str "lot"],Space,Str "of",Space,Str "money",Str ".",Space,Str "So",Space,Str "is",Space,Str "$",Str "34,000",Str ".",Space,Str "(It",Space,Str "worked",Space,Str "if",Space,Quoted DoubleQuote [Str "lot"],Space,Str "is",Space,Str "emphasized",Str ".",Str ")"] ]
231231 , [ Plain [Str "Escaped",Space,Code "$",Str ":",Space,Str "$",Str "73",Space,Emph [Str "this",Space,Str "should",Space,Str "be",Space,Str "emphasized"],Space,Str "23",Str "$",Str "."] ] ]
232−, Para [Str "Here's",Space,Str "a",Space,Str "LaTeX",Space,Str "table:"]
232+, Para [Str "Here",Apostrophe,Str "s",Space,Str "a",Space,Str "LaTeX",Space,Str "table:"]
233233, Para [TeX "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}"]
234234, HorizontalRule
235235, Header 1 [Str "Special",Space,Str "Characters"]
@@ -240,11 +240,11 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
240240 , [ Plain [Str "section:",Space,Str "\167"] ]
241241 , [ Plain [Str "set",Space,Str "membership:",Space,Str "\8712"] ]
242242 , [ Plain [Str "copyright:",Space,Str "\169"] ] ]
243−, Para [Str "AT&T",Space,Str "has",Space,Str "an",Space,Str "ampersand",Space,Str "in",Space,Str "their",Space,Str "name."]
244−, Para [Str "AT&T",Space,Str "is",Space,Str "another",Space,Str "way",Space,Str "to",Space,Str "write",Space,Str "it."]
245−, Para [Str "This",Space,Str "&",Space,Str "that."]
246−, Para [Str "4",Space,Str "<",Space,Str "5."]
247−, Para [Str "6",Space,Str ">",Space,Str "5."]
243+, Para [Str "AT&T",Space,Str "has",Space,Str "an",Space,Str "ampersand",Space,Str "in",Space,Str "their",Space,Str "name",Str "."]
244+, Para [Str "AT&T",Space,Str "is",Space,Str "another",Space,Str "way",Space,Str "to",Space,Str "write",Space,Str "it",Str "."]
245+, Para [Str "This",Space,Str "&",Space,Str "that",Str "."]
246+, Para [Str "4",Space,Str "<",Space,Str "5",Str "."]
247+, Para [Str "6",Space,Str ">",Space,Str "5",Str "."]
248248, Para [Str "Backslash:",Space,Str "\\"]
249249, Para [Str "Backtick:",Space,Str "`"]
250250, Para [Str "Asterisk:",Space,Str "*"]
@@ -278,11 +278,11 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
278278, Para [Str "Foo",Space,Link [Str "bar"] (Ref [Str "a"]),Str "."]
279279, Key [Str "a"] (Src "/url/" "")
280280, Para [Str "With",Space,Link [Str "embedded",Space,Str "[",Str "brackets",Str "]"] (Ref [Str "b"]),Str "."]
281−, Para [Link [Str "b"] (Ref [Str "b"]),Space,Str "by",Space,Str "itself",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "link."]
281+, Para [Link [Str "b"] (Ref [Str "b"]),Space,Str "by",Space,Str "itself",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "link",Str "."]
282282, Para [Str "Indented",Space,Link [Str "once"] (Ref [Str "once"]),Str "."]
283283, Para [Str "Indented",Space,Link [Str "twice"] (Ref [Str "twice"]),Str "."]
284284, Para [Str "Indented",Space,Link [Str "thrice"] (Ref [Str "thrice"]),Str "."]
285−, Para [Str "This",Space,Str "should",Space,Str "[",Str "not",Str "]",Str "[",Str "]",Space,Str "be",Space,Str "a",Space,Str "link."]
285+, Para [Str "This",Space,Str "should",Space,Str "[",Str "not",Str "]",Str "[",Str "]",Space,Str "be",Space,Str "a",Space,Str "link",Str "."]
286286, Key [Str "once"] (Src "/url" "")
287287, Key [Str "twice"] (Src "/url" "")
288288, Key [Str "thrice"] (Src "/url" "")
@@ -292,10 +292,10 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
292292, Para [Str "Foo",Space,Link [Str "biz"] (Src "/url/" "Title with &quot;quote&quot; inside"),Str "."]
293293, Key [Str "bar"] (Src "/url/" "Title with &quot;quotes&quot; inside")
294294, Header 2 [Str "With",Space,Str "ampersands"]
295−, Para [Str "Here's",Space,Str "a",Space,Link [Str "link",Space,Str "with",Space,Str "an",Space,Str "ampersand",Space,Str "in",Space,Str "the",Space,Str "URL"] (Ref [Str "1"]),Str "."]
296−, Para [Str "Here's",Space,Str "a",Space,Str "link",Space,Str "with",Space,Str "an",Space,Str "amersand",Space,Str "in",Space,Str "the",Space,Str "link",Space,Str "text:",Space,Link [Str "AT&T"] (Ref [Str "2"]),Str "."]
297−, Para [Str "Here's",Space,Str "an",Space,Link [Str "inline",Space,Str "link"] (Src "/script?foo=1&bar=2" ""),Str "."]
298−, Para [Str "Here's",Space,Str "an",Space,Link [Str "inline",Space,Str "link",Space,Str "in",Space,Str "pointy",Space,Str "braces"] (Src "/script?foo=1&bar=2" ""),Str "."]
295+, Para [Str "Here",Apostrophe,Str "s",Space,Str "a",Space,Link [Str "link",Space,Str "with",Space,Str "an",Space,Str "ampersand",Space,Str "in",Space,Str "the",Space,Str "URL"] (Ref [Str "1"]),Str "."]
296+, Para [Str "Here",Apostrophe,Str "s",Space,Str "a",Space,Str "link",Space,Str "with",Space,Str "an",Space,Str "amersand",Space,Str "in",Space,Str "the",Space,Str "link",Space,Str "text:",Space,Link [Str "AT&T"] (Ref [Str "2"]),Str "."]
297+, Para [Str "Here",Apostrophe,Str "s",Space,Str "an",Space,Link [Str "inline",Space,Str "link"] (Src "/script?foo=1&bar=2" ""),Str "."]
298+, Para [Str "Here",Apostrophe,Str "s",Space,Str "an",Space,Link [Str "inline",Space,Str "link",Space,Str "in",Space,Str "pointy",Space,Str "braces"] (Src "/script?foo=1&bar=2" ""),Str "."]
299299, Key [Str "1"] (Src "http://example.com/?foo=1&bar=2" "")
300300, Key [Str "2"] (Src "http://att.com/" "AT&T")
301301, Header 2 [Str "Autolinks"]
@@ -303,7 +303,7 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
303303, BulletList
304304 [ [ Plain [Str "In",Space,Str "a",Space,Str "list?"] ]
305305 , [ Plain [Link [Str "http://example.com/"] (Src "http://example.com/" "")] ]
306− , [ Plain [Str "It",Space,Str "should."] ] ]
306+ , [ Plain [Str "It",Space,Str "should",Str "."] ] ]
307307, Para [Str "An",Space,Str "e",Str "-",Str "mail",Space,Str "address:",Space,Link [Str "nobody@nowhere.net"] (Src "mailto:nobody@nowhere.net" "")]
308308, BlockQuote
309309 [ Para [Str "Blockquoted:",Space,Link [Str "http://example.com/"] (Src "http://example.com/" "")] ]
@@ -312,34 +312,34 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
312312, CodeBlock "or here: <http://example.com/>"
313313, HorizontalRule
314314, Header 1 [Str "Images"]
315−, Para [Str "From",Space,Str "\"Voyage",Space,Str "dans",Space,Str "la",Space,Str "Lune\"",Space,Str "by",Space,Str "Georges",Space,Str "Melies",Space,Str "(1902):"]
315+, Para [Str "From",Space,Quoted DoubleQuote [Str "Voyage",Space,Str "dans",Space,Str "la",Space,Str "Lune"],Space,Str "by",Space,Str "Georges",Space,Str "Melies",Space,Str "(1902):"]
316316, Para [Image [Str "lalune"] (Ref [Str "lalune"])]
317317, Key [Str "lalune"] (Src "lalune.jpg" "Voyage dans la Lune")
318−, Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "movie",Space,Image [Str "movie"] (Src "movie.jpg" ""),Space,Str "icon."]
318+, Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "movie",Space,Image [Str "movie"] (Src "movie.jpg" ""),Space,Str "icon",Str "."]
319319, HorizontalRule
320320, Header 1 [Str "Footnotes"]
321−, Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "footnote",Space,Str "reference,",NoteRef "1",Space,Str "and",Space,Str "another.",NoteRef "2",Space,Str "This",Space,Str "should",Space,Emph [Str "not"],Space,Str "be",Space,Str "a",Space,Str "footnote",Space,Str "reference,",Space,Str "because",Space,Str "it",Space,Str "contains",Space,Str "a",Space,Str "space.",Str "[",Str "^",Str "my",Space,Str "note",Str "]",Space,Str "Here",Space,Str "is",Space,Str "an",Space,Str "inline",Space,Str "note.",NoteRef "3"]
321+, Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "footnote",Space,Str "reference,",NoteRef "1",Space,Str "and",Space,Str "another",Str ".",NoteRef "2",Space,Str "This",Space,Str "should",Space,Emph [Str "not"],Space,Str "be",Space,Str "a",Space,Str "footnote",Space,Str "reference,",Space,Str "because",Space,Str "it",Space,Str "contains",Space,Str "a",Space,Str "space",Str ".",Str "[",Str "^",Str "my",Space,Str "note",Str "]",Space,Str "Here",Space,Str "is",Space,Str "an",Space,Str "inline",Space,Str "note",Str ".",NoteRef "3"]
322322, BlockQuote
323− [ Para [Str "Notes",Space,Str "can",Space,Str "go",Space,Str "in",Space,Str "quotes.",NoteRef "4"] ]
323+ [ Para [Str "Notes",Space,Str "can",Space,Str "go",Space,Str "in",Space,Str "quotes",Str ".",NoteRef "4"] ]
324324
325325, OrderedList
326− [ [ Plain [Str "And",Space,Str "in",Space,Str "list",Space,Str "items.",NoteRef "5"] ]
326+ [ [ Plain [Str "And",Space,Str "in",Space,Str "list",Space,Str "items",Str ".",NoteRef "5"] ]
327327 ]
328−, Para [Str "This",Space,Str "paragraph",Space,Str "should",Space,Str "not",Space,Str "be",Space,Str "part",Space,Str "of",Space,Str "the",Space,Str "note,",Space,Str "as",Space,Str "it",Space,Str "is",Space,Str "not",Space,Str "indented."]
328+, Para [Str "This",Space,Str "paragraph",Space,Str "should",Space,Str "not",Space,Str "be",Space,Str "part",Space,Str "of",Space,Str "the",Space,Str "note,",Space,Str "as",Space,Str "it",Space,Str "is",Space,Str "not",Space,Str "indented",Str "."]
329329, Note "1"
330− [ Para [Str "Here",Space,Str "is",Space,Str "the",Space,Str "footnote.",Space,Str "It",Space,Str "can",Space,Str "go",Space,Str "anywhere",Space,Str "after",Space,Str "the",Space,Str "footnote",Space,Str "reference.",Space,Str "It",Space,Str "need",Space,Str "not",Space,Str "be",Space,Str "placed",Space,Str "at",Space,Str "the",Space,Str "end",Space,Str "of",Space,Str "the",Space,Str "document."] ]
330+ [ Para [Str "Here",Space,Str "is",Space,Str "the",Space,Str "footnote",Str ".",Space,Str "It",Space,Str "can",Space,Str "go",Space,Str "anywhere",Space,Str "after",Space,Str "the",Space,Str "footnote",Space,Str "reference",Str ".",Space,Str "It",Space,Str "need",Space,Str "not",Space,Str "be",Space,Str "placed",Space,Str "at",Space,Str "the",Space,Str "end",Space,Str "of",Space,Str "the",Space,Str "document",Str "."] ]
331331
332332, Note "2"
333− [ Para [Str "Here's",Space,Str "the",Space,Str "long",Space,Str "note.",Space,Str "This",Space,Str "one",Space,Str "contains",Space,Str "multiple",Space,Str "blocks."]
334− , Para [Str "Subsequent",Space,Str "blocks",Space,Str "are",Space,Str "indented",Space,Str "to",Space,Str "show",Space,Str "that",Space,Str "they",Space,Str "belong",Space,Str "to",Space,Str "the",Space,Str "footnote",Space,Str "(as",Space,Str "with",Space,Str "list",Space,Str "items)."]
333+ [ Para [Str "Here",Apostrophe,Str "s",Space,Str "the",Space,Str "long",Space,Str "note",Str ".",Space,Str "This",Space,Str "one",Space,Str "contains",Space,Str "multiple",Space,Str "blocks",Str "."]
334+ , Para [Str "Subsequent",Space,Str "blocks",Space,Str "are",Space,Str "indented",Space,Str "to",Space,Str "show",Space,Str "that",Space,Str "they",Space,Str "belong",Space,Str "to",Space,Str "the",Space,Str "footnote",Space,Str "(as",Space,Str "with",Space,Str "list",Space,Str "items)",Str "."]
335335 , CodeBlock " { <code> }"
336− , Para [Str "If",Space,Str "you",Space,Str "want,",Space,Str "you",Space,Str "can",Space,Str "indent",Space,Str "every",Space,Str "line,",Space,Str "but",Space,Str "you",Space,Str "can",Space,Str "also",Space,Str "be",Space,Str "lazy",Space,Str "and",Space,Str "just",Space,Str "indent",Space,Str "the",Space,Str "first",Space,Str "line",Space,Str "of",Space,Str "each",Space,Str "block."] ]
336+ , Para [Str "If",Space,Str "you",Space,Str "want,",Space,Str "you",Space,Str "can",Space,Str "indent",Space,Str "every",Space,Str "line,",Space,Str "but",Space,Str "you",Space,Str "can",Space,Str "also",Space,Str "be",Space,Str "lazy",Space,Str "and",Space,Str "just",Space,Str "indent",Space,Str "the",Space,Str "first",Space,Str "line",Space,Str "of",Space,Str "each",Space,Str "block",Str "."] ]
337337, Note "3"
338− [ Para [Str "This",Space,Str "is",Space,Emph [Str "easier"],Space,Str "to",Space,Str "type.",Space,Str "Inline",Space,Str "notes",Space,Str "may",Space,Str "contain",Space,Link [Str "links"] (Src "http://google.com" ""),Space,Str "and",Space,Code "]",Space,Str "verbatim",Space,Str "characters."] ]
338+ [ Para [Str "This",Space,Str "is",Space,Emph [Str "easier"],Space,Str "to",Space,Str "type",Str ".",Space,Str "Inline",Space,Str "notes",Space,Str "may",Space,Str "contain",Space,Link [Str "links"] (Src "http://google.com" ""),Space,Str "and",Space,Code "]",Space,Str "verbatim",Space,Str "characters",Str "."] ]
339339
340340, Note "4"
341− [ Para [Str "In",Space,Str "quote."] ]
341+ [ Para [Str "In",Space,Str "quote",Str "."] ]
342342
343343, Note "5"
344− [ Para [Str "In",Space,Str "list."] ]
344+ [ Para [Str "In",Space,Str "list",Str "."] ]
345345 ]
tests/writer.docbook+32−29
@@ -17,7 +17,7 @@
1717 </articleinfo>
1818 <para>
1919 This is a set of tests for pandoc. Most of them are adapted from
20− John Gruber's markdown test suite.
20+ John Gruber&apos;s markdown test suite.
2121 </para>
2222 <section>
2323 <title>Headers</title>
@@ -58,7 +58,7 @@
5858 <section>
5959 <title>Paragraphs</title>
6060 <para>
61− Here's a regular paragraph.
61+ Here&apos;s a regular paragraph.
6262 </para>
6363 <para>
6464 In Markdown 1.0.0 and earlier. Version 8. This line turns into a
@@ -66,7 +66,7 @@
6666 looked like a list item.
6767 </para>
6868 <para>
69− Here's one with a bullet. * criminey.
69+ Here&apos;s one with a bullet. * criminey.
7070 </para>
7171 <para>
7272 There should be a hard line
@@ -152,7 +152,7 @@ sub status {
152152 </orderedlist>
153153 </blockquote>
154154 <para>
155− Here's a nested one:
155+ Here&apos;s a nested one:
156156 </para>
157157 <blockquote>
158158 <para>
@@ -160,7 +160,7 @@ sub status {
160160 </para>
161161 <blockquote>
162162 <para>
163− Don't quote me.
163+ Don&apos;t quote me.
164164 </para>
165165 </blockquote>
166166 </blockquote>
@@ -407,8 +407,8 @@ These should not be escaped: \$ \\ \&gt; \[ \{
407407 Item 1, graf one.
408408 </para>
409409 <para>
410− Item 1. graf two. The quick brown fox jumped over the lazy dog's
411− back.
410+ Item 1. graf two. The quick brown fox jumped over the lazy
411+ dog&apos;s back.
412412 </para>
413413 </listitem>
414414 <listitem>
@@ -447,7 +447,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
447447 </listitem>
448448 </itemizedlist>
449449 <para>
450− Here's another:
450+ Here&apos;s another:
451451 </para>
452452 <orderedlist>
453453 <listitem>
@@ -585,30 +585,33 @@ These should not be escaped: \$ \\ \&gt; \[ \{
585585 <section>
586586 <title>Smart quotes, ellipses, dashes</title>
587587 <para>
588− &quot;Hello,&quot; said the spider. &quot;'Shelob' is my
589− name.&quot;
588+ <quote>Hello,</quote> said the spider.
589+ <quote><quote>Shelob</quote> is my name.</quote>
590590 </para>
591591 <para>
592− 'A', 'B', and 'C' are letters.
592+ <quote>A</quote>, <quote>B</quote>, and <quote>C</quote> are
593+ letters.
593594 </para>
594595 <para>
595− 'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'
596+ <quote>Oak,</quote> <quote>elm,</quote> and <quote>beech</quote>
597+ are names of trees. So is <quote>pine.</quote>
596598 </para>
597599 <para>
598− 'He said, &quot;I want to go.&quot;' Were you alive in the 70's?
600+ <quote>He said, <quote>I want to go.</quote></quote> Were you alive
601+ in the 70&apos;s?
599602 </para>
600603 <para>
601− Here is some quoted '<literal>code</literal>' and a
602− &quot;<ulink url="http://example.com/?foo=1&amp;bar=2">quoted link</ulink>&quot;.
604+ Here is some quoted <quote><literal>code</literal></quote> and a
605+ <quote><ulink url="http://example.com/?foo=1&amp;bar=2">quoted link</ulink></quote>.
603606 </para>
604607 <para>
605− Some dashes: one---two --- three--four -- five.
608+ Some dashes: one&mdash;two&mdash;three&mdash;four&mdash;five.
606609 </para>
607610 <para>
608− Dashes between numbers: 5-7, 255-66, 1987-1999.
611+ Dashes between numbers: 5&ndash;7, 255&ndash;66, 1987&ndash;1999.
609612 </para>
610613 <para>
611− Ellipses...and. . .and . . . .
614+ Ellipses&hellip;and&hellip;and&hellip;.
612615 </para>
613616 </section>
614617 <section>
@@ -656,13 +659,13 @@ These should not be escaped: \$ \\ \&gt; \[ \{
656659 </listitem>
657660 <listitem>
658661 <para>
659− Here's one that has a line break in it:
662+ Here&apos;s one that has a line break in it:
660663 <literal>$\alpha + \omega \times x^2$</literal>.
661664 </para>
662665 </listitem>
663666 </itemizedlist>
664667 <para>
665− These shouldn't be math:
668+ These shouldn&apos;t be math:
666669 </para>
667670 <itemizedlist>
668671 <listitem>
@@ -673,7 +676,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
673676 <listitem>
674677 <para>
675678 $22,000 is a <emphasis>lot</emphasis> of money. So is $34,000. (It
676− worked if &quot;lot&quot; is emphasized.)
679+ worked if <quote>lot</quote> is emphasized.)
677680 </para>
678681 </listitem>
679682 <listitem>
@@ -684,7 +687,7 @@ These should not be escaped: \$ \\ \&gt; \[ \{
684687 </listitem>
685688 </itemizedlist>
686689 <para>
687− Here's a LaTeX table:
690+ Here&apos;s a LaTeX table:
688691 </para>
689692 <para>
690693 <literal>\begin{tabular}{|l|l|}\hline
@@ -861,18 +864,19 @@ Cat &amp; 1 \\ \hline
861864 <section>
862865 <title>With ampersands</title>
863866 <para>
864− Here's a
867+ Here&apos;s a
865868 <ulink url="http://example.com/?foo=1&amp;bar=2">link with an ampersand in the URL</ulink>.
866869 </para>
867870 <para>
868− Here's a link with an amersand in the link text:
871+ Here&apos;s a link with an amersand in the link text:
869872 <ulink url="http://att.com/">AT&amp;T</ulink>.
870873 </para>
871874 <para>
872− Here's an <ulink url="/script?foo=1&amp;bar=2">inline link</ulink>.
875+ Here&apos;s an
876+ <ulink url="/script?foo=1&amp;bar=2">inline link</ulink>.
873877 </para>
874878 <para>
875− Here's an
879+ Here&apos;s an
876880 <ulink url="/script?foo=1&amp;bar=2">inline link in pointy braces</ulink>.
877881 </para>
878882 </section>
@@ -920,7 +924,7 @@ or here: &lt;http://example.com/&gt;
920924 <section>
921925 <title>Images</title>
922926 <para>
923− From &quot;Voyage dans la Lune&quot; by Georges Melies (1902):
927+ From <quote>Voyage dans la Lune</quote> by Georges Melies (1902):
924928 </para>
925929 <para>
926930 <inlinemediaobject>
@@ -957,7 +961,7 @@ or here: &lt;http://example.com/&gt;
957961 and
958962 another.<footnote>
959963 <para>
960− Here's the long note. This one contains multiple blocks.
964+ Here&apos;s the long note. This one contains multiple blocks.
961965 </para>
962966 <para>
963967 Subsequent blocks are indented to show that they belong to the
@@ -1008,5 +1012,4 @@ or here: &lt;http://example.com/&gt;
10081012 indented.
10091013 </para>
10101014 </section>
1011−
10121015</article>
tests/writer.html+627−276
@@ -4,13 +4,19 @@
44<head>
55<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
66<meta name="generator" content="pandoc" />
7+
78<meta name="author" content="John MacFarlane, Anonymous" />
89<meta name="date" content="July 17, 2006" />
910<title>Pandoc Test Suite</title>
1011</head>
1112<body>
12−<h1 class="title">Pandoc Test Suite</h1>
13−<p>This is a set of tests for pandoc. Most of them are adapted from John Gruber's markdown test suite.</p>
13+<h1 class="title">
14+Pandoc Test Suite
15+</h1>
16+<p>
17+ This is a set of tests for pandoc. Most of them are adapted from
18+ John Gruber&rsquo;s markdown test suite.
19+</p>
1420<hr />
1521<h1>Headers</h1>
1622<h2>Level 2 with an <a href="/url">embedded link</a></h2>
@@ -20,67 +26,110 @@
2026<h1>Level 1</h1>
2127<h2>Level 2 with <em>emphasis</em></h2>
2228<h3>Level 3</h3>
23−<p>with no blank line</p>
29+<p>
30+ with no blank line
31+</p>
2432<h2>Level 2</h2>
25−<p>with no blank line</p>
33+<p>
34+ with no blank line
35+</p>
2636<hr />
2737<h1>Paragraphs</h1>
28−<p>Here's a regular paragraph.</p>
29−<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>
30−<p>Here's one with a bullet. * criminey.</p>
31−<p>There should be a hard line break<br />
32−here.</p>
38+<p>
39+ Here&rsquo;s a regular paragraph.
40+</p>
41+<p>
42+ In Markdown 1.0.0 and earlier. Version 8. This line turns into a
43+ list item. Because a hard-wrapped line in the middle of a paragraph
44+ looked like a list item.
45+</p>
46+<p>
47+ Here&rsquo;s one with a bullet. * criminey.
48+</p>
49+<p>
50+ There should be a hard line break<br />here.
51+</p>
3352<hr />
3453<h1>Block Quotes</h1>
35−<p>E-mail style:</p>
54+<p>
55+ E-mail style:
56+</p>
3657<blockquote>
37−<p>This is a block quote. It is pretty short.</p>
58+ <p>
59+ This is a block quote. It is pretty short.
60+ </p>
3861</blockquote>
3962<blockquote>
40−<p>Code in a block quote:</p>
41−<pre><code>sub status {
63+ <p>
64+ Code in a block quote:
65+ </p>
66+ <pre><code>sub status {
4267 print &quot;working&quot;;
4368}
4469</code></pre>
45−<p>A list:</p>
46−<ol>
47−<li>item one</li>
48−<li>item two</li>
49−</ol>
50−<p>Nested block quotes:</p>
51−<blockquote>
52−<p>nested</p>
53−</blockquote>
54−<blockquote>
55−<p>nested</p>
56−</blockquote>
70+ <p>
71+ A list:
72+ </p>
73+ <ol>
74+ <li>item one</li>
75+ <li>item two</li>
76+ </ol>
77+ <p>
78+ Nested block quotes:
79+ </p>
80+ <blockquote>
81+ <p>
82+ nested
83+ </p>
84+ </blockquote>
85+ <blockquote>
86+ <p>
87+ nested
88+ </p>
89+ </blockquote>
5790</blockquote>
58−<p>This should not be a block quote: 2 &gt; 1.</p>
59−<p>Box-style:</p>
91+<p>
92+ This should not be a block quote: 2 &gt; 1.
93+</p>
94+<p>
95+ Box-style:
96+</p>
6097<blockquote>
61−<p>Example:</p>
62−<pre><code>sub status {
98+ <p>
99+ Example:
100+ </p>
101+ <pre><code>sub status {
63102 print &quot;working&quot;;
64103}
65104</code></pre>
66105</blockquote>
67106<blockquote>
68−<ol>
69−<li>do laundry</li>
70−<li>take out the trash</li>
71−</ol>
107+ <ol>
108+ <li>do laundry</li>
109+ <li>take out the trash</li>
110+ </ol>
72111</blockquote>
73−<p>Here's a nested one:</p>
74−<blockquote>
75−<p>Joe said:</p>
112+<p>
113+ Here&rsquo;s a nested one:
114+</p>
76115<blockquote>
77−<p>Don't quote me.</p>
116+ <p>
117+ Joe said:
118+ </p>
119+ <blockquote>
120+ <p>
121+ Don&rsquo;t quote me.
122+ </p>
123+ </blockquote>
78124</blockquote>
79−</blockquote>
80−<p>And a following paragraph.</p>
125+<p>
126+ And a following paragraph.
127+</p>
81128<hr />
82129<h1>Code Blocks</h1>
83−<p>Code:</p>
130+<p>
131+ Code:
132+</p>
84133<pre><code>---- (should be four hyphens)
85134
86135sub status {
@@ -89,7 +138,9 @@ sub status {
89138
90139this code block is indented by one tab
91140</code></pre>
92−<p>And:</p>
141+<p>
142+ And:
143+</p>
93144<pre><code> this code block is indented by two tabs
94145
95146These should not be escaped: \$ \\ \&gt; \[ \{
@@ -97,181 +148,273 @@ These should not be escaped: \$ \\ \&gt; \[ \{
97148<hr />
98149<h1>Lists</h1>
99150<h2>Unordered</h2>
100−<p>Asterisks tight:</p>
151+<p>
152+ Asterisks tight:
153+</p>
101154<ul>
102−<li>asterisk 1</li>
103−<li>asterisk 2</li>
104−<li>asterisk 3</li>
155+ <li>asterisk 1</li>
156+ <li>asterisk 2</li>
157+ <li>asterisk 3</li>
105158</ul>
106−<p>Asterisks loose:</p>
159+<p>
160+ Asterisks loose:
161+</p>
107162<ul>
108−<li><p>asterisk 1</p>
109−</li>
110−<li><p>asterisk 2</p>
111−</li>
112−<li><p>asterisk 3</p>
113−</li>
163+ <li><p>
164+ asterisk 1
165+ </p></li>
166+ <li><p>
167+ asterisk 2
168+ </p></li>
169+ <li><p>
170+ asterisk 3
171+ </p></li>
114172</ul>
115−<p>Pluses tight:</p>
173+<p>
174+ Pluses tight:
175+</p>
116176<ul>
117−<li>Plus 1</li>
118−<li>Plus 2</li>
119−<li>Plus 3</li>
177+ <li>Plus 1</li>
178+ <li>Plus 2</li>
179+ <li>Plus 3</li>
120180</ul>
121−<p>Pluses loose:</p>
181+<p>
182+ Pluses loose:
183+</p>
122184<ul>
123−<li><p>Plus 1</p>
124−</li>
125−<li><p>Plus 2</p>
126−</li>
127−<li><p>Plus 3</p>
128−</li>
185+ <li><p>
186+ Plus 1
187+ </p></li>
188+ <li><p>
189+ Plus 2
190+ </p></li>
191+ <li><p>
192+ Plus 3
193+ </p></li>
129194</ul>
130−<p>Minuses tight:</p>
195+<p>
196+ Minuses tight:
197+</p>
131198<ul>
132−<li>Minus 1</li>
133−<li>Minus 2</li>
134−<li>Minus 3</li>
199+ <li>Minus 1</li>
200+ <li>Minus 2</li>
201+ <li>Minus 3</li>
135202</ul>
136−<p>Minuses loose:</p>
203+<p>
204+ Minuses loose:
205+</p>
137206<ul>
138−<li><p>Minus 1</p>
139−</li>
140−<li><p>Minus 2</p>
141−</li>
142−<li><p>Minus 3</p>
143−</li>
207+ <li><p>
208+ Minus 1
209+ </p></li>
210+ <li><p>
211+ Minus 2
212+ </p></li>
213+ <li><p>
214+ Minus 3
215+ </p></li>
144216</ul>
145217<h2>Ordered</h2>
146−<p>Tight:</p>
218+<p>
219+ Tight:
220+</p>
147221<ol>
148−<li>First</li>
149−<li>Second</li>
150−<li>Third</li>
222+ <li>First</li>
223+ <li>Second</li>
224+ <li>Third</li>
151225</ol>
152−<p>and:</p>
226+<p>
227+ and:
228+</p>
153229<ol>
154−<li>One</li>
155−<li>Two</li>
156−<li>Three</li>
230+ <li>One</li>
231+ <li>Two</li>
232+ <li>Three</li>
157233</ol>
158−<p>Loose using tabs:</p>
234+<p>
235+ Loose using tabs:
236+</p>
159237<ol>
160−<li><p>First</p>
161−</li>
162−<li><p>Second</p>
163−</li>
164−<li><p>Third</p>
165−</li>
238+ <li><p>
239+ First
240+ </p></li>
241+ <li><p>
242+ Second
243+ </p></li>
244+ <li><p>
245+ Third
246+ </p></li>
166247</ol>
167−<p>and using spaces:</p>
248+<p>
249+ and using spaces:
250+</p>
168251<ol>
169−<li><p>One</p>
170−</li>
171−<li><p>Two</p>
172−</li>
173−<li><p>Three</p>
174−</li>
252+ <li><p>
253+ One
254+ </p></li>
255+ <li><p>
256+ Two
257+ </p></li>
258+ <li><p>
259+ Three
260+ </p></li>
175261</ol>
176−<p>Multiple paragraphs:</p>
262+<p>
263+ Multiple paragraphs:
264+</p>
177265<ol>
178−<li><p>Item 1, graf one.</p>
179−<p>Item 1. graf two. The quick brown fox jumped over the lazy dog's back.</p>
180−</li>
181−<li><p>Item 2.</p>
182−</li>
183−<li><p>Item 3.</p>
184−</li>
266+ <li><p>
267+ Item 1, graf one.
268+ </p>
269+ <p>
270+ Item 1. graf two. The quick brown fox jumped over the lazy
271+ dog&rsquo;s back.
272+ </p></li>
273+ <li><p>
274+ Item 2.
275+ </p></li>
276+ <li><p>
277+ Item 3.
278+ </p></li>
185279</ol>
186280<h2>Nested</h2>
187281<ul>
188−<li>Tab<ul>
189−<li>Tab<ul>
190−<li>Tab</li>
191−</ul>
192−</li>
193−</ul>
194−</li>
282+ <li>Tab
283+ <ul>
284+ <li>Tab
285+ <ul>
286+ <li>Tab</li>
287+ </ul></li>
288+ </ul></li>
195289</ul>
196−<p>Here's another:</p>
290+<p>
291+ Here&rsquo;s another:
292+</p>
197293<ol>
198−<li>First</li>
199−<li>Second:<ul>
200−<li>Fee</li>
201−<li>Fie</li>
202−<li>Foe</li>
203−</ul>
204−</li>
205−<li>Third</li>
294+ <li>First</li>
295+ <li>Second:
296+ <ul>
297+ <li>Fee</li>
298+ <li>Fie</li>
299+ <li>Foe</li>
300+ </ul></li>
301+ <li>Third</li>
206302</ol>
207−<p>Same thing but with paragraphs:</p>
303+<p>
304+ Same thing but with paragraphs:
305+</p>
208306<ol>
209−<li><p>First</p>
210−</li>
211−<li><p>Second:</p>
212−<ul>
213−<li>Fee</li>
214−<li>Fie</li>
215−<li>Foe</li>
216−</ul>
217−</li>
218−<li><p>Third</p>
219−</li>
307+ <li><p>
308+ First
309+ </p></li>
310+ <li><p>
311+ Second:
312+ </p>
313+ <ul>
314+ <li>Fee</li>
315+ <li>Fie</li>
316+ <li>Foe</li>
317+ </ul></li>
318+ <li><p>
319+ Third
320+ </p></li>
220321</ol>
221322<h2>Tabs and spaces</h2>
222323<ul>
223−<li><p>this is a list item indented with tabs</p>
224−</li>
225−<li><p>this is a list item indented with spaces</p>
226−<ul>
227−<li><p>this is an example list item indented with tabs</p>
228−</li>
229−<li><p>this is an example list item indented with spaces</p>
230−</li>
231−</ul>
232−</li>
324+ <li><p>
325+ this is a list item indented with tabs
326+ </p></li>
327+ <li><p>
328+ this is a list item indented with spaces
329+ </p>
330+ <ul>
331+ <li><p>
332+ this is an example list item indented with tabs
333+ </p></li>
334+ <li><p>
335+ this is an example list item indented with spaces
336+ </p></li>
337+ </ul></li>
233338</ul>
234339<hr />
235340<h1>HTML Blocks</h1>
236−<p>Simple block on one line:</p>
237−<div>foo</div>
238−<p>And nested without indentation:</p>
341+<p>
342+ Simple block on one line:
343+</p>
344+<div>
345+foo
346+</div>
347+
348+<p>
349+ And nested without indentation:
350+</p>
351+<div>
239352<div>
240353<div>
241−<div>foo</div>
354+foo
355+</div>
356+</div>
357+<div>
358+bar
242359</div>
243−<div>bar</div>
244360</div>
245−<p>Interpreted markdown in a table:</p>
361+
362+<p>
363+ Interpreted markdown in a table:
364+</p>
246365<table>
247366<tr>
248−<td>This is <em>emphasized</em></td>
249−<td>And this is <strong>strong</strong></td>
367+<td>
368+This is <em>emphasized</em>
369+</td>
370+<td>
371+And this is <strong>strong</strong>
372+</td>
250373</tr>
251374</table>
252375
253376<script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
254−<p>Here's a simple block:</p>
377+
378+<p>
379+ Here&rsquo;s a simple block:
380+</p>
255381<div>
256− foo</div>
257−<p>This should be a code block, though:</p>
382+
383+foo
384+</div>
385+
386+<p>
387+ This should be a code block, though:
388+</p>
258389<pre><code>&lt;div&gt;
259390 foo
260391&lt;/div&gt;
261392</code></pre>
262−<p>As should this:</p>
393+<p>
394+ As should this:
395+</p>
263396<pre><code>&lt;div&gt;foo&lt;/div&gt;
264397</code></pre>
265−<p>Now, nested:</p>
398+<p>
399+ Now, nested:
400+</p>
266401<div>
267402 <div>
268403 <div>
269− foo</div>
404+
405+foo
406+</div>
270407 </div>
271408</div>
272−<p>This should just be an HTML comment:</p>
409+
410+<p>
411+ This should just be an HTML comment:
412+</p>
273413<!-- Comment -->
274−<p>Multiline:</p>
414+
415+<p>
416+ Multiline:
417+</p>
275418<!--
276419Blah
277420Blah
@@ -280,15 +423,25 @@ Blah
280423<!--
281424 This is another comment.
282425-->
283−<p>Code block:</p>
426+
427+<p>
428+ Code block:
429+</p>
284430<pre><code>&lt;!-- Comment --&gt;
285431</code></pre>
286−<p>Just plain comment, with trailing spaces on the line:</p>
432+<p>
433+ Just plain comment, with trailing spaces on the line:
434+</p>
287435<!-- foo -->
288−<p>Code:</p>
436+
437+<p>
438+ Code:
439+</p>
289440<pre><code>&lt;hr /&gt;
290441</code></pre>
291−<p>Hr's:</p>
442+<p>
443+ Hr&rsquo;s:
444+</p>
292445<hr>
293446
294447<hr />
@@ -306,169 +459,367 @@ Blah
306459<hr class="foo" id="bar" />
307460
308461<hr class="foo" id="bar">
462+
309463<hr />
310464<h1>Inline Markup</h1>
311−<p>This is <em>emphasized</em>, and so <em>is this</em>.</p>
312−<p>This is <strong>strong</strong>, and so <strong>is this</strong>.</p>
313−<p>An <em><a href="/url">emphasized link</a></em>.</p>
314−<p><strong><em>This is strong and em.</em></strong></p>
315−<p>So is <strong><em>this</em></strong> word.</p>
316−<p><strong><em>This is strong and em.</em></strong></p>
317−<p>So is <strong><em>this</em></strong> word.</p>
318−<p>This is code: <code>&gt;</code>, <code>$</code>, <code>\</code>, <code>\$</code>, <code>&lt;html&gt;</code>.</p>
465+<p>
466+ This is <em>emphasized</em>, and so <em>is this</em>.
467+</p>
468+<p>
469+ This is <strong>strong</strong>, and so <strong>is this</strong>.
470+</p>
471+<p>
472+ An <em><a href="/url">emphasized link</a></em>.
473+</p>
474+<p>
475+ <strong><em>This is strong and em.</em></strong>
476+</p>
477+<p>
478+ So is <strong><em>this</em></strong> word.
479+</p>
480+<p>
481+ <strong><em>This is strong and em.</em></strong>
482+</p>
483+<p>
484+ So is <strong><em>this</em></strong> word.
485+</p>
486+<p>
487+ This is code: <code>&gt;</code>, <code>$</code>, <code>\</code>,
488+ <code>\$</code>, <code>&lt;html&gt;</code>.
489+</p>
319490<hr />
320491<h1>Smart quotes, ellipses, dashes</h1>
321−<p>&quot;Hello,&quot; said the spider. &quot;'Shelob' is my name.&quot;</p>
322−<p>'A', 'B', and 'C' are letters.</p>
323−<p>'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'</p>
324−<p>'He said, &quot;I want to go.&quot;' Were you alive in the 70's?</p>
325−<p>Here is some quoted '<code>code</code>' and a &quot;<a href="http://example.com/?foo=1&amp;bar=2">quoted link</a>&quot;.</p>
326−<p>Some dashes: one---two --- three--four -- five.</p>
327−<p>Dashes between numbers: 5-7, 255-66, 1987-1999.</p>
328−<p>Ellipses...and. . .and . . . .</p>
492+<p>
493+ &ldquo;Hello,&rdquo; said the spider.
494+ &ldquo;&lsquo;Shelob&rsquo; is my name.&rdquo;
495+</p>
496+<p>
497+ &lsquo;A&rsquo;, &lsquo;B&rsquo;, and &lsquo;C&rsquo; are letters.
498+</p>
499+<p>
500+ &lsquo;Oak,&rsquo; &lsquo;elm,&rsquo; and &lsquo;beech&rsquo; are
501+ names of trees. So is &lsquo;pine.&rsquo;
502+</p>
503+<p>
504+ &lsquo;He said, &ldquo;I want to go.&rdquo;&rsquo; Were you alive
505+ in the 70&rsquo;s?
506+</p>
507+<p>
508+ Here is some quoted &lsquo;<code>code</code>&rsquo; and a
509+ &ldquo;<a href="http://example.com/?foo=1&amp;bar=2">quoted link</a>&rdquo;.
510+</p>
511+<p>
512+ Some dashes: one&mdash;two&mdash;three&mdash;four&mdash;five.
513+</p>
514+<p>
515+ Dashes between numbers: 5&ndash;7, 255&ndash;66, 1987&ndash;1999.
516+</p>
517+<p>
518+ Ellipses&hellip;and&hellip;and&hellip;.
519+</p>
329520<hr />
330521<h1>LaTeX</h1>
331522<ul>
332−<li>\cite[22-23]{smith.1899}</li>
333−<li>\doublespacing</li>
334−<li>$2+2=4$</li>
335−<li>$x \in y$</li>
336−<li>$\alpha \wedge \omega$</li>
337−<li>$223$</li>
338−<li>$p$-Tree</li>
339−<li>$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</li>
340−<li>Here's one that has a line break in it: $\alpha + \omega \times x^2$.</li>
523+ <li>\cite[22-23]{smith.1899}</li>
524+ <li>\doublespacing</li>
525+ <li>$2+2=4$</li>
526+ <li>$x \in y$</li>
527+ <li>$\alpha \wedge \omega$</li>
528+ <li>$223$</li>
529+ <li>$p$-Tree</li>
530+ <li>$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</li>
531+ <li>Here&rsquo;s one that has a line break in it:
532+ $\alpha + \omega \times x^2$.</li>
341533</ul>
342−<p>These shouldn't be math:</p>
534+<p>
535+ These shouldn&rsquo;t be math:
536+</p>
343537<ul>
344−<li>To get the famous equation, write <code>$e = mc^2$</code>.</li>
345−<li>$22,000 is a <em>lot</em> of money. So is $34,000. (It worked if &quot;lot&quot; is emphasized.)</li>
346−<li>Escaped <code>$</code>: $73 <em>this should be emphasized</em> 23$.</li>
538+ <li>To get the famous equation, write <code>$e = mc^2$</code>.</li>
539+ <li>$22,000 is a <em>lot</em> of money. So is $34,000. (It worked
540+ if &ldquo;lot&rdquo; is emphasized.)</li>
541+ <li>Escaped <code>$</code>: $73 <em>this should be emphasized</em>
542+ 23$.</li>
347543</ul>
348−<p>Here's a LaTeX table:</p>
349−<p>\begin{tabular}{|l|l|}\hline
544+<p>
545+ Here&rsquo;s a LaTeX table:
546+</p>
547+<p>
548+ \begin{tabular}{|l|l|}\hline
350549Animal &amp; Number \\ \hline
351550Dog &amp; 2 \\
352551Cat &amp; 1 \\ \hline
353−\end{tabular}</p>
552+\end{tabular}
553+</p>
354554<hr />
355555<h1>Special Characters</h1>
356−<p>Here is some unicode:</p>
556+<p>
557+ Here is some unicode:
558+</p>
357559<ul>
358−<li>I hat: &Icirc;</li>
359−<li>o umlaut: &ouml;</li>
360−<li>section: &sect;</li>
361−<li>set membership: &isin;</li>
362−<li>copyright: &copy;</li>
560+ <li>I hat: &Icirc;</li>
561+ <li>o umlaut: &ouml;</li>
562+ <li>section: &sect;</li>
563+ <li>set membership: &isin;</li>
564+ <li>copyright: &copy;</li>
363565</ul>
364−<p>AT&amp;T has an ampersand in their name.</p>
365−<p>AT&amp;T is another way to write it.</p>
366−<p>This &amp; that.</p>
367−<p>4 &lt; 5.</p>
368−<p>6 &gt; 5.</p>
369−<p>Backslash: \</p>
370−<p>Backtick: `</p>
371−<p>Asterisk: *</p>
372−<p>Underscore: _</p>
373−<p>Left brace: {</p>
374−<p>Right brace: }</p>
375−<p>Left bracket: [</p>
376−<p>Right bracket: ]</p>
377−<p>Left paren: (</p>
378−<p>Right paren: )</p>
379−<p>Greater-than: &gt;</p>
380−<p>Hash: #</p>
381−<p>Period: .</p>
382−<p>Bang: !</p>
383−<p>Plus: +</p>
384−<p>Minus: -</p>
566+<p>
567+ AT&amp;T has an ampersand in their name.
568+</p>
569+<p>
570+ AT&amp;T is another way to write it.
571+</p>
572+<p>
573+ This &amp; that.
574+</p>
575+<p>
576+ 4 &lt; 5.
577+</p>
578+<p>
579+ 6 &gt; 5.
580+</p>
581+<p>
582+ Backslash: \
583+</p>
584+<p>
585+ Backtick: `
586+</p>
587+<p>
588+ Asterisk: *
589+</p>
590+<p>
591+ Underscore: _
592+</p>
593+<p>
594+ Left brace: {
595+</p>
596+<p>
597+ Right brace: }
598+</p>
599+<p>
600+ Left bracket: [
601+</p>
602+<p>
603+ Right bracket: ]
604+</p>
605+<p>
606+ Left paren: (
607+</p>
608+<p>
609+ Right paren: )
610+</p>
611+<p>
612+ Greater-than: &gt;
613+</p>
614+<p>
615+ Hash: #
616+</p>
617+<p>
618+ Period: .
619+</p>
620+<p>
621+ Bang: !
622+</p>
623+<p>
624+ Plus: +
625+</p>
626+<p>
627+ Minus: -
628+</p>
385629<hr />
386630<h1>Links</h1>
387631<h2>Explicit</h2>
388−<p>Just a <a href="/url/">URL</a>.</p>
389−<p><a href="/url/" title="title">URL and title</a>.</p>
390−<p><a href="/url/" title="title preceded by two spaces">URL and title</a>.</p>
391−<p><a href="/url/" title="title preceded by a tab">URL and title</a>.</p>
392−<p><a href="/url/" title="title with &quot;quotes&quot; in it">URL and title</a></p>
393−<p><a href="/url/" title="title with single quotes">URL and title</a></p>
394−<p><script type="text/javascript">
632+<p>
633+ Just a <a href="/url/">URL</a>.
634+</p>
635+<p>
636+ <a href="/url/" title="title">URL and title</a>.
637+</p>
638+<p>
639+ <a href="/url/" title="title preceded by two spaces">URL and title</a>.
640+</p>
641+<p>
642+ <a href="/url/" title="title preceded by a tab">URL and title</a>.
643+</p>
644+<p>
645+ <a href="/url/" title="title with &quot;quotes&quot; in it">URL and title</a>
646+</p>
647+<p>
648+ <a href="/url/" title="title with single quotes">URL and title</a>
649+</p>
650+<p>
651+ <script type="text/javascript">
395652<!--
396653h='&#110;&#x6f;&#x77;&#104;&#x65;&#114;&#x65;&#46;&#110;&#x65;&#116;';a='&#64;';n='&#110;&#x6f;&#98;&#x6f;&#100;&#x79;';e=n+a+h;
397654document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'Email link'+'<\/'+'a'+'>');
398655// -->
399−</script><noscript>&#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></p>
400−<p><a href="">Empty</a>.</p>
656+</script><noscript>&#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>
657+</p>
658+<p>
659+ <a href="">Empty</a>.
660+</p>
401661<h2>Reference</h2>
402−<p>Foo <a href="/url/">bar</a>.</p>
403−<p>Foo <a href="/url/">bar</a>.</p>
404−<p>Foo <a href="/url/">bar</a>.</p>
405−<p>With <a href="/url/">embedded [brackets]</a>.</p>
406−<p><a href="/url/">b</a> by itself should be a link.</p>
407−<p>Indented <a href="/url">once</a>.</p>
408−<p>Indented <a href="/url">twice</a>.</p>
409−<p>Indented <a href="/url">thrice</a>.</p>
410−<p>This should [not][] be a link.</p>
662+<p>
663+ Foo <a href="/url/">bar</a>.
664+</p>
665+<p>
666+ Foo <a href="/url/">bar</a>.
667+</p>
668+<p>
669+ Foo <a href="/url/">bar</a>.
670+</p>
671+<p>
672+ With <a href="/url/">embedded [brackets]</a>.
673+</p>
674+<p>
675+ <a href="/url/">b</a> by itself should be a link.
676+</p>
677+<p>
678+ Indented <a href="/url">once</a>.
679+</p>
680+<p>
681+ Indented <a href="/url">twice</a>.
682+</p>
683+<p>
684+ Indented <a href="/url">thrice</a>.
685+</p>
686+<p>
687+ This should [not][] be a link.
688+</p>
411689<pre><code>[not]: /url
412690</code></pre>
413−<p>Foo <a href="/url/" title="Title with &quot;quotes&quot; inside">bar</a>.</p>
414−<p>Foo <a href="/url/" title="Title with &quot;quote&quot; inside">biz</a>.</p>
691+<p>
692+ Foo
693+ <a href="/url/" title="Title with &quot;quotes&quot; inside">bar</a>.
694+</p>
695+<p>
696+ Foo
697+ <a href="/url/" title="Title with &quot;quote&quot; inside">biz</a>.
698+</p>
415699<h2>With ampersands</h2>
416−<p>Here's a <a href="http://example.com/?foo=1&amp;bar=2">link with an ampersand in the URL</a>.</p>
417−<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>
418−<p>Here's an <a href="/script?foo=1&amp;bar=2">inline link</a>.</p>
419−<p>Here's an <a href="/script?foo=1&amp;bar=2">inline link in pointy braces</a>.</p>
700+<p>
701+ Here&rsquo;s a
702+ <a href="http://example.com/?foo=1&amp;bar=2">link with an ampersand in the URL</a>.
703+</p>
704+<p>
705+ Here&rsquo;s a link with an amersand in the link text:
706+ <a href="http://att.com/" title="AT&amp;T">AT&amp;T</a>.
707+</p>
708+<p>
709+ Here&rsquo;s an <a href="/script?foo=1&amp;bar=2">inline link</a>.
710+</p>
711+<p>
712+ Here&rsquo;s an
713+ <a href="/script?foo=1&amp;bar=2">inline link in pointy braces</a>.
714+</p>
420715<h2>Autolinks</h2>
421−<p>With an ampersand: <a href="http://example.com/?foo=1&amp;bar=2">http://example.com/?foo=1&amp;bar=2</a></p>
716+<p>
717+ With an ampersand:
718+ <a href="http://example.com/?foo=1&amp;bar=2">http://example.com/?foo=1&amp;bar=2</a>
719+</p>
422720<ul>
423−<li>In a list?</li>
424−<li><a href="http://example.com/">http://example.com/</a></li>
425−<li>It should.</li>
721+ <li>In a list?</li>
722+ <li><a href="http://example.com/">http://example.com/</a></li>
723+ <li>It should.</li>
426724</ul>
427−<p>An e-mail address: <script type="text/javascript">
725+<p>
726+ An e-mail address:
727+ <script type="text/javascript">
428728<!--
429729h='&#110;&#x6f;&#x77;&#104;&#x65;&#114;&#x65;&#46;&#110;&#x65;&#116;';a='&#64;';n='&#110;&#x6f;&#98;&#x6f;&#100;&#x79;';e=n+a+h;
430730document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+e+'<\/'+'a'+'>');
431731// -->
432−</script><noscript>&#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></p>
732+</script><noscript>&#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>
733+</p>
433734<blockquote>
434−<p>Blockquoted: <a href="http://example.com/">http://example.com/</a></p>
735+ <p>
736+ Blockquoted: <a href="http://example.com/">http://example.com/</a>
737+ </p>
435738</blockquote>
436−<p>Auto-links should not occur here: <code>&lt;http://example.com/&gt;</code></p>
739+<p>
740+ Auto-links should not occur here:
741+ <code>&lt;http://example.com/&gt;</code>
742+</p>
437743<pre><code>or here: &lt;http://example.com/&gt;
438744</code></pre>
439745<hr />
440746<h1>Images</h1>
441−<p>From &quot;Voyage dans la Lune&quot; by Georges Melies (1902):</p>
442−<p><img src="lalune.jpg" title="Voyage dans la Lune" alt="lalune"></p>
443−<p>Here is a movie <img src="movie.jpg" alt="movie"> icon.</p>
747+<p>
748+ From &ldquo;Voyage dans la Lune&rdquo; by Georges Melies (1902):
749+</p>
750+<p>
751+ <img src="lalune.jpg" title="Voyage dans la Lune" alt="lalune" />
752+</p>
753+<p>
754+ Here is a movie <img src="movie.jpg" alt="movie" /> icon.
755+</p>
444756<hr />
445757<h1>Footnotes</h1>
446−<p>Here is a footnote reference,<sup class="footnoteRef" id="fnref1"><a href="#fn1">1</a></sup> and another.<sup class="footnoteRef" id="fnref2"><a href="#fn2">2</a></sup> This should <em>not</em> be a footnote reference, because it contains a space.[^my note] Here is an inline note.<sup class="footnoteRef" id="fnref3"><a href="#fn3">3</a></sup></p>
758+<p>
759+ Here is a footnote
760+ reference,<sup class="footnoteRef" id="fnref1"><a href="#fn1">1</a></sup>
761+ and
762+ another.<sup class="footnoteRef" id="fnref2"><a href="#fn2">2</a></sup>
763+ This should <em>not</em> be a footnote reference, because it
764+ contains a space.[^my note] Here is an inline
765+ note.<sup class="footnoteRef" id="fnref3"><a href="#fn3">3</a></sup>
766+</p>
447767<blockquote>
448−<p>Notes can go in quotes.<sup class="footnoteRef" id="fnref4"><a href="#fn4">4</a></sup></p>
768+ <p>
769+ Notes can go in
770+ quotes.<sup class="footnoteRef" id="fnref4"><a href="#fn4">4</a></sup>
771+ </p>
449772</blockquote>
450773<ol>
451−<li>And in list items.<sup class="footnoteRef" id="fnref5"><a href="#fn5">5</a></sup></li>
774+ <li>And in list
775+ items.<sup class="footnoteRef" id="fnref5"><a href="#fn5">5</a></sup></li>
452776</ol>
453−<p>This paragraph should not be part of the note, as it is not indented.</p>
777+<p>
778+ This paragraph should not be part of the note, as it is not
779+ indented.
780+</p>
454781<div class="footnotes">
455−<hr />
456−<ol>
457−<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.</p>
458− <a href="#fnref1" class="footnoteBacklink" title="Jump back to footnote 1">&#8617;</a></li>
459−<li id="fn2"><p>Here's the long note. This one contains multiple blocks.</p>
460−<p>Subsequent blocks are indented to show that they belong to the footnote (as with list items).</p>
461−<pre><code> { &lt;code&gt; }
782+ <hr />
783+ <ol>
784+ <li id="fn1">
785+ <p>
786+ Here is the footnote. It can go anywhere after the footnote
787+ reference. It need not be placed at the end of the document.
788+ </p><a href="#fnref1" class="footnoteBacklink" title="Jump back to footnote 1">&#8617;</a>
789+ </li>
790+ <li id="fn2">
791+ <p>
792+ Here&rsquo;s the long note. This one contains multiple blocks.
793+ </p>
794+ <p>
795+ Subsequent blocks are indented to show that they belong to the
796+ footnote (as with list items).
797+ </p>
798+ <pre><code> { &lt;code&gt; }
462799</code></pre>
463−<p>If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.</p>
464− <a href="#fnref2" class="footnoteBacklink" title="Jump back to footnote 2">&#8617;</a></li>
465−<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.</p>
466− <a href="#fnref3" class="footnoteBacklink" title="Jump back to footnote 3">&#8617;</a></li>
467−<li id="fn4"><p>In quote.</p>
468− <a href="#fnref4" class="footnoteBacklink" title="Jump back to footnote 4">&#8617;</a></li>
469−<li id="fn5"><p>In list.</p>
470− <a href="#fnref5" class="footnoteBacklink" title="Jump back to footnote 5">&#8617;</a></li>
471−</ol>
800+ <p>
801+ If you want, you can indent every line, but you can also be lazy
802+ and just indent the first line of each block.
803+ </p><a href="#fnref2" class="footnoteBacklink" title="Jump back to footnote 2">&#8617;</a>
804+ </li>
805+ <li id="fn3">
806+ <p>
807+ This is <em>easier</em> to type. Inline notes may contain
808+ <a href="http://google.com">links</a> and <code>]</code> verbatim
809+ characters.
810+ </p><a href="#fnref3" class="footnoteBacklink" title="Jump back to footnote 3">&#8617;</a>
811+ </li>
812+ <li id="fn4">
813+ <p>
814+ In quote.
815+ </p><a href="#fnref4" class="footnoteBacklink" title="Jump back to footnote 4">&#8617;</a>
816+ </li>
817+ <li id="fn5">
818+ <p>
819+ In list.
820+ </p><a href="#fnref5" class="footnoteBacklink" title="Jump back to footnote 5">&#8617;</a>
821+ </li>
822+ </ol>
472823</div>
473824</body>
474825</html>
tests/writer.latex+2−2
@@ -373,7 +373,7 @@ This is code: \verb!>!, \verb!$!, \verb!\!, \verb!\$!, \verb!<html>!.
373373
374374\section{Smart quotes, ellipses, dashes}
375375
376−``Hello,'' said the spider. ``{}`Shelob' is my name.''
376+``Hello,'' said the spider. ```Shelob' is my name.''
377377
378378`A', `B', and `C' are letters.
379379
@@ -387,7 +387,7 @@ Some dashes: one---two---three---four---five.
387387
388388Dashes between numbers: 5--7, 255--66, 1987--1999.
389389
390−Ellipses\ldots{}and\ldots{}and \ldots{} .
390+Ellipses\ldots{}and\ldots{}and\ldots{}.
391391
392392\begin{center}\rule{3in}{0.4pt}\end{center}
393393
tests/writer.markdown+2−2
@@ -403,11 +403,11 @@ This is code: `>`, `$`, `\`, `\$`, `<html>`.
403403
404404Here is some quoted '`code`' and a "[quoted link][1]".
405405
406−Some dashes: one---two --- three--four -- five.
406+Some dashes: one--two--three--four--five.
407407
408408Dashes between numbers: 5-7, 255-66, 1987-1999.
409409
410−Ellipses...and. . .and . . . .
410+Ellipses...and...and....
411411
412412
413413* * * * *
tests/writer.native+57−57
@@ -1,5 +1,5 @@
11Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane","Anonymous"] "July 17, 2006")
2−[ Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "set",Space,Str "of",Space,Str "tests",Space,Str "for",Space,Str "pandoc.",Space,Str "Most",Space,Str "of",Space,Str "them",Space,Str "are",Space,Str "adapted",Space,Str "from",Space,Str "John",Space,Str "Gruber's",Space,Str "markdown",Space,Str "test",Space,Str "suite."]
2+[ Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "set",Space,Str "of",Space,Str "tests",Space,Str "for",Space,Str "pandoc",Str ".",Space,Str "Most",Space,Str "of",Space,Str "them",Space,Str "are",Space,Str "adapted",Space,Str "from",Space,Str "John",Space,Str "Gruber",Apostrophe,Str "s",Space,Str "markdown",Space,Str "test",Space,Str "suite",Str "."]
33, HorizontalRule
44, Header 1 [Str "Headers"]
55, Header 2 [Str "Level",Space,Str "2",Space,Str "with",Space,Str "an",Space,Link [Str "embedded",Space,Str "link"] (Src "/url" "")]
@@ -14,15 +14,15 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
1414, Para [Str "with",Space,Str "no",Space,Str "blank",Space,Str "line"]
1515, HorizontalRule
1616, Header 1 [Str "Paragraphs"]
17−, Para [Str "Here's",Space,Str "a",Space,Str "regular",Space,Str "paragraph."]
18−, Para [Str "In",Space,Str "Markdown",Space,Str "1.0.0",Space,Str "and",Space,Str "earlier.",Space,Str "Version",Space,Str "8.",Space,Str "This",Space,Str "line",Space,Str "turns",Space,Str "into",Space,Str "a",Space,Str "list",Space,Str "item.",Space,Str "Because",Space,Str "a",Space,Str "hard",Str "-",Str "wrapped",Space,Str "line",Space,Str "in",Space,Str "the",Space,Str "middle",Space,Str "of",Space,Str "a",Space,Str "paragraph",Space,Str "looked",Space,Str "like",Space,Str "a",Space,Str "list",Space,Str "item."]
19−, Para [Str "Here's",Space,Str "one",Space,Str "with",Space,Str "a",Space,Str "bullet.",Space,Str "*",Space,Str "criminey."]
20−, Para [Str "There",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "hard",Space,Str "line",Space,Str "break",LineBreak,Str "here."]
17+, Para [Str "Here",Apostrophe,Str "s",Space,Str "a",Space,Str "regular",Space,Str "paragraph",Str "."]
18+, Para [Str "In",Space,Str "Markdown",Space,Str "1",Str ".",Str "0",Str ".",Str "0",Space,Str "and",Space,Str "earlier",Str ".",Space,Str "Version",Space,Str "8",Str ".",Space,Str "This",Space,Str "line",Space,Str "turns",Space,Str "into",Space,Str "a",Space,Str "list",Space,Str "item",Str ".",Space,Str "Because",Space,Str "a",Space,Str "hard",Str "-",Str "wrapped",Space,Str "line",Space,Str "in",Space,Str "the",Space,Str "middle",Space,Str "of",Space,Str "a",Space,Str "paragraph",Space,Str "looked",Space,Str "like",Space,Str "a",Space,Str "list",Space,Str "item",Str "."]
19+, Para [Str "Here",Apostrophe,Str "s",Space,Str "one",Space,Str "with",Space,Str "a",Space,Str "bullet",Str ".",Space,Str "*",Space,Str "criminey",Str "."]
20+, Para [Str "There",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "hard",Space,Str "line",Space,Str "break",LineBreak,Str "here",Str "."]
2121, HorizontalRule
2222, Header 1 [Str "Block",Space,Str "Quotes"]
2323, Para [Str "E",Str "-",Str "mail",Space,Str "style:"]
2424, BlockQuote
25− [ Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "block",Space,Str "quote.",Space,Str "It",Space,Str "is",Space,Str "pretty",Space,Str "short."] ]
25+ [ Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "block",Space,Str "quote",Str ".",Space,Str "It",Space,Str "is",Space,Str "pretty",Space,Str "short",Str "."] ]
2626
2727, BlockQuote
2828 [ Para [Str "Code",Space,Str "in",Space,Str "a",Space,Str "block",Space,Str "quote:"]
@@ -38,7 +38,7 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
3838 , BlockQuote
3939 [ Para [Str "nested"] ]
4040 ]
41−, Para [Str "This",Space,Str "should",Space,Str "not",Space,Str "be",Space,Str "a",Space,Str "block",Space,Str "quote:",Space,Str "2",Space,Str ">",Space,Str "1."]
41+, Para [Str "This",Space,Str "should",Space,Str "not",Space,Str "be",Space,Str "a",Space,Str "block",Space,Str "quote:",Space,Str "2",Space,Str ">",Space,Str "1",Str "."]
4242, Para [Str "Box",Str "-",Str "style:"]
4343, BlockQuote
4444 [ Para [Str "Example:"]
@@ -47,13 +47,13 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
4747 [ OrderedList
4848 [ [ Plain [Str "do",Space,Str "laundry"] ]
4949 , [ Plain [Str "take",Space,Str "out",Space,Str "the",Space,Str "trash"] ] ] ]
50−, Para [Str "Here's",Space,Str "a",Space,Str "nested",Space,Str "one:"]
50+, Para [Str "Here",Apostrophe,Str "s",Space,Str "a",Space,Str "nested",Space,Str "one:"]
5151, BlockQuote
5252 [ Para [Str "Joe",Space,Str "said:"]
5353 , BlockQuote
54− [ Para [Str "Don't",Space,Str "quote",Space,Str "me."] ]
54+ [ Para [Str "Don",Apostrophe,Str "t",Space,Str "quote",Space,Str "me",Str "."] ]
5555 ]
56−, Para [Str "And",Space,Str "a",Space,Str "following",Space,Str "paragraph."]
56+, Para [Str "And",Space,Str "a",Space,Str "following",Space,Str "paragraph",Str "."]
5757, HorizontalRule
5858, Header 1 [Str "Code",Space,Str "Blocks"]
5959, Para [Str "Code:"]
@@ -116,9 +116,9 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
116116 , [ Para [Str "Three"] ] ]
117117, Para [Str "Multiple",Space,Str "paragraphs:"]
118118, OrderedList
119− [ [ Para [Str "Item",Space,Str "1,",Space,Str "graf",Space,Str "one."]
120− , Para [Str "Item",Space,Str "1.",Space,Str "graf",Space,Str "two.",Space,Str "The",Space,Str "quick",Space,Str "brown",Space,Str "fox",Space,Str "jumped",Space,Str "over",Space,Str "the",Space,Str "lazy",Space,Str "dog's",Space,Str "back."] ], [ Para [Str "Item",Space,Str "2."] ]
121− , [ Para [Str "Item",Space,Str "3."] ] ]
119+ [ [ Para [Str "Item",Space,Str "1,",Space,Str "graf",Space,Str "one",Str "."]
120+ , Para [Str "Item",Space,Str "1",Str ".",Space,Str "graf",Space,Str "two",Str ".",Space,Str "The",Space,Str "quick",Space,Str "brown",Space,Str "fox",Space,Str "jumped",Space,Str "over",Space,Str "the",Space,Str "lazy",Space,Str "dog",Apostrophe,Str "s",Space,Str "back",Str "."] ], [ Para [Str "Item",Space,Str "2",Str "."] ]
121+ , [ Para [Str "Item",Space,Str "3",Str "."] ] ]
122122, Header 2 [Str "Nested"]
123123, BulletList
124124 [ [ Plain [Str "Tab"]
@@ -127,7 +127,7 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
127127 , BulletList
128128 [ [ Plain [Str "Tab"] ]
129129 ] ] ] ] ]
130−, Para [Str "Here's",Space,Str "another:"]
130+, Para [Str "Here",Apostrophe,Str "s",Space,Str "another:"]
131131, OrderedList
132132 [ [ Plain [Str "First"] ]
133133 , [ Plain [Str "Second:"]
@@ -168,7 +168,7 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
168168, RawHtml "</td>\n<td>"
169169, Plain [Str "And",Space,Str "this",Space,Str "is",Space,Strong [Str "strong"]]
170170, RawHtml "</td>\n</tr>\n</table>\n\n<script type=\"text/javascript\">document.write('This *should not* be interpreted as markdown');</script>\n"
171−, Para [Str "Here's",Space,Str "a",Space,Str "simple",Space,Str "block:"]
171+, Para [Str "Here",Apostrophe,Str "s",Space,Str "a",Space,Str "simple",Space,Str "block:"]
172172, RawHtml "<div>\n "
173173, Plain [Str "foo"]
174174, RawHtml "</div>\n"
@@ -190,28 +190,28 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
190190, RawHtml "<!-- foo --> \n"
191191, Para [Str "Code:"]
192192, CodeBlock "<hr />"
193−, Para [Str "Hr's:"]
193+, Para [Str "Hr",Apostrophe,Str "s:"]
194194, RawHtml "<hr>\n\n<hr />\n\n<hr />\n\n<hr> \n\n<hr /> \n\n<hr /> \n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\" />\n\n<hr class=\"foo\" id=\"bar\">\n"
195195, HorizontalRule
196196, Header 1 [Str "Inline",Space,Str "Markup"]
197197, Para [Str "This",Space,Str "is",Space,Emph [Str "emphasized"],Str ",",Space,Str "and",Space,Str "so",Space,Emph [Str "is",Space,Str "this"],Str "."]
198198, Para [Str "This",Space,Str "is",Space,Strong [Str "strong"],Str ",",Space,Str "and",Space,Str "so",Space,Strong [Str "is",Space,Str "this"],Str "."]
199199, Para [Str "An",Space,Emph [Link [Str "emphasized",Space,Str "link"] (Src "/url" "")],Str "."]
200−, Para [Strong [Emph [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em."]]]
201−, Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word."]
202−, Para [Strong [Emph [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em."]]]
203−, Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word."]
200+, Para [Strong [Emph [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em",Str "."]]]
201+, Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word",Str "."]
202+, Para [Strong [Emph [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em",Str "."]]]
203+, Para [Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word",Str "."]
204204, Para [Str "This",Space,Str "is",Space,Str "code:",Space,Code ">",Str ",",Space,Code "$",Str ",",Space,Code "\\",Str ",",Space,Code "\\$",Str ",",Space,Code "<html>",Str "."]
205205, HorizontalRule
206206, Header 1 [Str "Smart",Space,Str "quotes,",Space,Str "ellipses,",Space,Str "dashes"]
207−, Para [Str "\"Hello,\"",Space,Str "said",Space,Str "the",Space,Str "spider.",Space,Str "\"'Shelob'",Space,Str "is",Space,Str "my",Space,Str "name.\""]
208−, Para [Str "'A',",Space,Str "'B',",Space,Str "and",Space,Str "'C'",Space,Str "are",Space,Str "letters."]
209−, Para [Str "'Oak,'",Space,Str "'elm,'",Space,Str "and",Space,Str "'beech'",Space,Str "are",Space,Str "names",Space,Str "of",Space,Str "trees.",Space,Str "So",Space,Str "is",Space,Str "'pine.'"]
210−, Para [Str "'He",Space,Str "said,",Space,Str "\"I",Space,Str "want",Space,Str "to",Space,Str "go.\"'",Space,Str "Were",Space,Str "you",Space,Str "alive",Space,Str "in",Space,Str "the",Space,Str "70's?"]
211−, Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "quoted",Space,Str "'",Code "code",Str "'",Space,Str "and",Space,Str "a",Space,Str "\"",Link [Str "quoted",Space,Str "link"] (Ref [Str "1"]),Str "\"."]
212−, Para [Str "Some",Space,Str "dashes:",Space,Str "one",Str "---",Str "two",Space,Str "---",Space,Str "three",Str "--",Str "four",Space,Str "--",Space,Str "five."]
213−, Para [Str "Dashes",Space,Str "between",Space,Str "numbers:",Space,Str "5",Str "-",Str "7,",Space,Str "255",Str "-",Str "66,",Space,Str "1987",Str "-",Str "1999."]
214−, Para [Str "Ellipses...and.",Space,Str ".",Space,Str ".and",Space,Str ".",Space,Str ".",Space,Str ".",Space,Str "."]
207+, Para [Quoted DoubleQuote [Str "Hello,"],Space,Str "said",Space,Str "the",Space,Str "spider",Str ".",Space,Quoted DoubleQuote [Quoted SingleQuote [Str "Shelob"],Space,Str "is",Space,Str "my",Space,Str "name",Str "."]]
208+, Para [Quoted SingleQuote [Str "A"],Str ",",Space,Quoted SingleQuote [Str "B"],Str ",",Space,Str "and",Space,Quoted SingleQuote [Str "C"],Space,Str "are",Space,Str "letters",Str "."]
209+, Para [Quoted SingleQuote [Str "Oak,"],Space,Quoted SingleQuote [Str "elm,"],Space,Str "and",Space,Quoted SingleQuote [Str "beech"],Space,Str "are",Space,Str "names",Space,Str "of",Space,Str "trees",Str ".",Space,Str "So",Space,Str "is",Space,Quoted SingleQuote [Str "pine",Str "."]]
210+, Para [Quoted SingleQuote [Str "He",Space,Str "said,",Space,Quoted DoubleQuote [Str "I",Space,Str "want",Space,Str "to",Space,Str "go",Str "."]],Space,Str "Were",Space,Str "you",Space,Str "alive",Space,Str "in",Space,Str "the",Space,Str "70",Apostrophe,Str "s?"]
211+, Para [Str "Here",Space,Str "is",Space,Str "some",Space,Str "quoted",Space,Quoted SingleQuote [Code "code"],Space,Str "and",Space,Str "a",Space,Quoted DoubleQuote [Link [Str "quoted",Space,Str "link"] (Ref [Str "1"])],Str "."]
212+, Para [Str "Some",Space,Str "dashes:",Space,Str "one",EmDash,Str "two",EmDash,Str "three",EmDash,Str "four",EmDash,Str "five",Str "."]
213+, Para [Str "Dashes",Space,Str "between",Space,Str "numbers:",Space,Str "5",EnDash,Str "7,",Space,Str "255",EnDash,Str "66,",Space,Str "1987",EnDash,Str "1999",Str "."]
214+, Para [Str "Ellipses",Ellipses,Str "and",Ellipses,Str "and",Ellipses,Str "."]
215215, HorizontalRule
216216, Header 1 [Str "LaTeX"]
217217, BulletList
@@ -223,13 +223,13 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
223223 , [ Plain [TeX "$223$"] ]
224224 , [ Plain [TeX "$p$",Str "-",Str "Tree"] ]
225225 , [ Plain [TeX "$\\frac{d}{dx}f(x)=\\lim_{h\\to 0}\\frac{f(x+h)-f(x)}{h}$"] ]
226− , [ Plain [Str "Here's",Space,Str "one",Space,Str "that",Space,Str "has",Space,Str "a",Space,Str "line",Space,Str "break",Space,Str "in",Space,Str "it:",Space,TeX "$\\alpha + \\omega \\times x^2$",Str "."] ] ]
227−, Para [Str "These",Space,Str "shouldn't",Space,Str "be",Space,Str "math:"]
226+ , [ Plain [Str "Here",Apostrophe,Str "s",Space,Str "one",Space,Str "that",Space,Str "has",Space,Str "a",Space,Str "line",Space,Str "break",Space,Str "in",Space,Str "it:",Space,TeX "$\\alpha + \\omega \\times x^2$",Str "."] ] ]
227+, Para [Str "These",Space,Str "shouldn",Apostrophe,Str "t",Space,Str "be",Space,Str "math:"]
228228, BulletList
229229 [ [ Plain [Str "To",Space,Str "get",Space,Str "the",Space,Str "famous",Space,Str "equation,",Space,Str "write",Space,Code "$e = mc^2$",Str "."] ]
230− , [ Plain [Str "$",Str "22,000",Space,Str "is",Space,Str "a",Space,Emph [Str "lot"],Space,Str "of",Space,Str "money.",Space,Str "So",Space,Str "is",Space,Str "$",Str "34,000.",Space,Str "(It",Space,Str "worked",Space,Str "if",Space,Str "\"lot\"",Space,Str "is",Space,Str "emphasized.)"] ]
230+ , [ Plain [Str "$",Str "22,000",Space,Str "is",Space,Str "a",Space,Emph [Str "lot"],Space,Str "of",Space,Str "money",Str ".",Space,Str "So",Space,Str "is",Space,Str "$",Str "34,000",Str ".",Space,Str "(It",Space,Str "worked",Space,Str "if",Space,Quoted DoubleQuote [Str "lot"],Space,Str "is",Space,Str "emphasized",Str ".",Str ")"] ]
231231 , [ Plain [Str "Escaped",Space,Code "$",Str ":",Space,Str "$",Str "73",Space,Emph [Str "this",Space,Str "should",Space,Str "be",Space,Str "emphasized"],Space,Str "23",Str "$",Str "."] ] ]
232−, Para [Str "Here's",Space,Str "a",Space,Str "LaTeX",Space,Str "table:"]
232+, Para [Str "Here",Apostrophe,Str "s",Space,Str "a",Space,Str "LaTeX",Space,Str "table:"]
233233, Para [TeX "\\begin{tabular}{|l|l|}\\hline\nAnimal & Number \\\\ \\hline\nDog & 2 \\\\\nCat & 1 \\\\ \\hline\n\\end{tabular}"]
234234, HorizontalRule
235235, Header 1 [Str "Special",Space,Str "Characters"]
@@ -240,11 +240,11 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
240240 , [ Plain [Str "section:",Space,Str "\167"] ]
241241 , [ Plain [Str "set",Space,Str "membership:",Space,Str "\8712"] ]
242242 , [ Plain [Str "copyright:",Space,Str "\169"] ] ]
243−, Para [Str "AT&T",Space,Str "has",Space,Str "an",Space,Str "ampersand",Space,Str "in",Space,Str "their",Space,Str "name."]
244−, Para [Str "AT&T",Space,Str "is",Space,Str "another",Space,Str "way",Space,Str "to",Space,Str "write",Space,Str "it."]
245−, Para [Str "This",Space,Str "&",Space,Str "that."]
246−, Para [Str "4",Space,Str "<",Space,Str "5."]
247−, Para [Str "6",Space,Str ">",Space,Str "5."]
243+, Para [Str "AT&T",Space,Str "has",Space,Str "an",Space,Str "ampersand",Space,Str "in",Space,Str "their",Space,Str "name",Str "."]
244+, Para [Str "AT&T",Space,Str "is",Space,Str "another",Space,Str "way",Space,Str "to",Space,Str "write",Space,Str "it",Str "."]
245+, Para [Str "This",Space,Str "&",Space,Str "that",Str "."]
246+, Para [Str "4",Space,Str "<",Space,Str "5",Str "."]
247+, Para [Str "6",Space,Str ">",Space,Str "5",Str "."]
248248, Para [Str "Backslash:",Space,Str "\\"]
249249, Para [Str "Backtick:",Space,Str "`"]
250250, Para [Str "Asterisk:",Space,Str "*"]
@@ -278,11 +278,11 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
278278, Para [Str "Foo",Space,Link [Str "bar"] (Ref [Str "a"]),Str "."]
279279, Key [Str "a"] (Src "/url/" "")
280280, Para [Str "With",Space,Link [Str "embedded",Space,Str "[",Str "brackets",Str "]"] (Ref [Str "b"]),Str "."]
281−, Para [Link [Str "b"] (Ref [Str "b"]),Space,Str "by",Space,Str "itself",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "link."]
281+, Para [Link [Str "b"] (Ref [Str "b"]),Space,Str "by",Space,Str "itself",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "link",Str "."]
282282, Para [Str "Indented",Space,Link [Str "once"] (Ref [Str "once"]),Str "."]
283283, Para [Str "Indented",Space,Link [Str "twice"] (Ref [Str "twice"]),Str "."]
284284, Para [Str "Indented",Space,Link [Str "thrice"] (Ref [Str "thrice"]),Str "."]
285−, Para [Str "This",Space,Str "should",Space,Str "[",Str "not",Str "]",Str "[",Str "]",Space,Str "be",Space,Str "a",Space,Str "link."]
285+, Para [Str "This",Space,Str "should",Space,Str "[",Str "not",Str "]",Str "[",Str "]",Space,Str "be",Space,Str "a",Space,Str "link",Str "."]
286286, Key [Str "once"] (Src "/url" "")
287287, Key [Str "twice"] (Src "/url" "")
288288, Key [Str "thrice"] (Src "/url" "")
@@ -292,10 +292,10 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
292292, Para [Str "Foo",Space,Link [Str "biz"] (Src "/url/" "Title with &quot;quote&quot; inside"),Str "."]
293293, Key [Str "bar"] (Src "/url/" "Title with &quot;quotes&quot; inside")
294294, Header 2 [Str "With",Space,Str "ampersands"]
295−, Para [Str "Here's",Space,Str "a",Space,Link [Str "link",Space,Str "with",Space,Str "an",Space,Str "ampersand",Space,Str "in",Space,Str "the",Space,Str "URL"] (Ref [Str "1"]),Str "."]
296−, Para [Str "Here's",Space,Str "a",Space,Str "link",Space,Str "with",Space,Str "an",Space,Str "amersand",Space,Str "in",Space,Str "the",Space,Str "link",Space,Str "text:",Space,Link [Str "AT&T"] (Ref [Str "2"]),Str "."]
297−, Para [Str "Here's",Space,Str "an",Space,Link [Str "inline",Space,Str "link"] (Src "/script?foo=1&bar=2" ""),Str "."]
298−, Para [Str "Here's",Space,Str "an",Space,Link [Str "inline",Space,Str "link",Space,Str "in",Space,Str "pointy",Space,Str "braces"] (Src "/script?foo=1&bar=2" ""),Str "."]
295+, Para [Str "Here",Apostrophe,Str "s",Space,Str "a",Space,Link [Str "link",Space,Str "with",Space,Str "an",Space,Str "ampersand",Space,Str "in",Space,Str "the",Space,Str "URL"] (Ref [Str "1"]),Str "."]
296+, Para [Str "Here",Apostrophe,Str "s",Space,Str "a",Space,Str "link",Space,Str "with",Space,Str "an",Space,Str "amersand",Space,Str "in",Space,Str "the",Space,Str "link",Space,Str "text:",Space,Link [Str "AT&T"] (Ref [Str "2"]),Str "."]
297+, Para [Str "Here",Apostrophe,Str "s",Space,Str "an",Space,Link [Str "inline",Space,Str "link"] (Src "/script?foo=1&bar=2" ""),Str "."]
298+, Para [Str "Here",Apostrophe,Str "s",Space,Str "an",Space,Link [Str "inline",Space,Str "link",Space,Str "in",Space,Str "pointy",Space,Str "braces"] (Src "/script?foo=1&bar=2" ""),Str "."]
299299, Key [Str "1"] (Src "http://example.com/?foo=1&bar=2" "")
300300, Key [Str "2"] (Src "http://att.com/" "AT&T")
301301, Header 2 [Str "Autolinks"]
@@ -303,7 +303,7 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
303303, BulletList
304304 [ [ Plain [Str "In",Space,Str "a",Space,Str "list?"] ]
305305 , [ Plain [Link [Str "http://example.com/"] (Src "http://example.com/" "")] ]
306− , [ Plain [Str "It",Space,Str "should."] ] ]
306+ , [ Plain [Str "It",Space,Str "should",Str "."] ] ]
307307, Para [Str "An",Space,Str "e",Str "-",Str "mail",Space,Str "address:",Space,Link [Str "nobody@nowhere.net"] (Src "mailto:nobody@nowhere.net" "")]
308308, BlockQuote
309309 [ Para [Str "Blockquoted:",Space,Link [Str "http://example.com/"] (Src "http://example.com/" "")] ]
@@ -312,34 +312,34 @@ Pandoc (Meta [Str "Pandoc",Space,Str "Test",Space,Str "Suite"] ["John MacFarlane
312312, CodeBlock "or here: <http://example.com/>"
313313, HorizontalRule
314314, Header 1 [Str "Images"]
315−, Para [Str "From",Space,Str "\"Voyage",Space,Str "dans",Space,Str "la",Space,Str "Lune\"",Space,Str "by",Space,Str "Georges",Space,Str "Melies",Space,Str "(1902):"]
315+, Para [Str "From",Space,Quoted DoubleQuote [Str "Voyage",Space,Str "dans",Space,Str "la",Space,Str "Lune"],Space,Str "by",Space,Str "Georges",Space,Str "Melies",Space,Str "(1902):"]
316316, Para [Image [Str "lalune"] (Ref [Str "lalune"])]
317317, Key [Str "lalune"] (Src "lalune.jpg" "Voyage dans la Lune")
318−, Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "movie",Space,Image [Str "movie"] (Src "movie.jpg" ""),Space,Str "icon."]
318+, Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "movie",Space,Image [Str "movie"] (Src "movie.jpg" ""),Space,Str "icon",Str "."]
319319, HorizontalRule
320320, Header 1 [Str "Footnotes"]
321−, Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "footnote",Space,Str "reference,",NoteRef "1",Space,Str "and",Space,Str "another.",NoteRef "2",Space,Str "This",Space,Str "should",Space,Emph [Str "not"],Space,Str "be",Space,Str "a",Space,Str "footnote",Space,Str "reference,",Space,Str "because",Space,Str "it",Space,Str "contains",Space,Str "a",Space,Str "space.",Str "[",Str "^",Str "my",Space,Str "note",Str "]",Space,Str "Here",Space,Str "is",Space,Str "an",Space,Str "inline",Space,Str "note.",NoteRef "3"]
321+, Para [Str "Here",Space,Str "is",Space,Str "a",Space,Str "footnote",Space,Str "reference,",NoteRef "1",Space,Str "and",Space,Str "another",Str ".",NoteRef "2",Space,Str "This",Space,Str "should",Space,Emph [Str "not"],Space,Str "be",Space,Str "a",Space,Str "footnote",Space,Str "reference,",Space,Str "because",Space,Str "it",Space,Str "contains",Space,Str "a",Space,Str "space",Str ".",Str "[",Str "^",Str "my",Space,Str "note",Str "]",Space,Str "Here",Space,Str "is",Space,Str "an",Space,Str "inline",Space,Str "note",Str ".",NoteRef "3"]
322322, BlockQuote
323− [ Para [Str "Notes",Space,Str "can",Space,Str "go",Space,Str "in",Space,Str "quotes.",NoteRef "4"] ]
323+ [ Para [Str "Notes",Space,Str "can",Space,Str "go",Space,Str "in",Space,Str "quotes",Str ".",NoteRef "4"] ]
324324
325325, OrderedList
326− [ [ Plain [Str "And",Space,Str "in",Space,Str "list",Space,Str "items.",NoteRef "5"] ]
326+ [ [ Plain [Str "And",Space,Str "in",Space,Str "list",Space,Str "items",Str ".",NoteRef "5"] ]
327327 ]
328−, Para [Str "This",Space,Str "paragraph",Space,Str "should",Space,Str "not",Space,Str "be",Space,Str "part",Space,Str "of",Space,Str "the",Space,Str "note,",Space,Str "as",Space,Str "it",Space,Str "is",Space,Str "not",Space,Str "indented."]
328+, Para [Str "This",Space,Str "paragraph",Space,Str "should",Space,Str "not",Space,Str "be",Space,Str "part",Space,Str "of",Space,Str "the",Space,Str "note,",Space,Str "as",Space,Str "it",Space,Str "is",Space,Str "not",Space,Str "indented",Str "."]
329329, Note "1"
330− [ Para [Str "Here",Space,Str "is",Space,Str "the",Space,Str "footnote.",Space,Str "It",Space,Str "can",Space,Str "go",Space,Str "anywhere",Space,Str "after",Space,Str "the",Space,Str "footnote",Space,Str "reference.",Space,Str "It",Space,Str "need",Space,Str "not",Space,Str "be",Space,Str "placed",Space,Str "at",Space,Str "the",Space,Str "end",Space,Str "of",Space,Str "the",Space,Str "document."] ]
330+ [ Para [Str "Here",Space,Str "is",Space,Str "the",Space,Str "footnote",Str ".",Space,Str "It",Space,Str "can",Space,Str "go",Space,Str "anywhere",Space,Str "after",Space,Str "the",Space,Str "footnote",Space,Str "reference",Str ".",Space,Str "It",Space,Str "need",Space,Str "not",Space,Str "be",Space,Str "placed",Space,Str "at",Space,Str "the",Space,Str "end",Space,Str "of",Space,Str "the",Space,Str "document",Str "."] ]
331331
332332, Note "2"
333− [ Para [Str "Here's",Space,Str "the",Space,Str "long",Space,Str "note.",Space,Str "This",Space,Str "one",Space,Str "contains",Space,Str "multiple",Space,Str "blocks."]
334− , Para [Str "Subsequent",Space,Str "blocks",Space,Str "are",Space,Str "indented",Space,Str "to",Space,Str "show",Space,Str "that",Space,Str "they",Space,Str "belong",Space,Str "to",Space,Str "the",Space,Str "footnote",Space,Str "(as",Space,Str "with",Space,Str "list",Space,Str "items)."]
333+ [ Para [Str "Here",Apostrophe,Str "s",Space,Str "the",Space,Str "long",Space,Str "note",Str ".",Space,Str "This",Space,Str "one",Space,Str "contains",Space,Str "multiple",Space,Str "blocks",Str "."]
334+ , Para [Str "Subsequent",Space,Str "blocks",Space,Str "are",Space,Str "indented",Space,Str "to",Space,Str "show",Space,Str "that",Space,Str "they",Space,Str "belong",Space,Str "to",Space,Str "the",Space,Str "footnote",Space,Str "(as",Space,Str "with",Space,Str "list",Space,Str "items)",Str "."]
335335 , CodeBlock " { <code> }"
336− , Para [Str "If",Space,Str "you",Space,Str "want,",Space,Str "you",Space,Str "can",Space,Str "indent",Space,Str "every",Space,Str "line,",Space,Str "but",Space,Str "you",Space,Str "can",Space,Str "also",Space,Str "be",Space,Str "lazy",Space,Str "and",Space,Str "just",Space,Str "indent",Space,Str "the",Space,Str "first",Space,Str "line",Space,Str "of",Space,Str "each",Space,Str "block."] ]
336+ , Para [Str "If",Space,Str "you",Space,Str "want,",Space,Str "you",Space,Str "can",Space,Str "indent",Space,Str "every",Space,Str "line,",Space,Str "but",Space,Str "you",Space,Str "can",Space,Str "also",Space,Str "be",Space,Str "lazy",Space,Str "and",Space,Str "just",Space,Str "indent",Space,Str "the",Space,Str "first",Space,Str "line",Space,Str "of",Space,Str "each",Space,Str "block",Str "."] ]
337337, Note "3"
338− [ Para [Str "This",Space,Str "is",Space,Emph [Str "easier"],Space,Str "to",Space,Str "type.",Space,Str "Inline",Space,Str "notes",Space,Str "may",Space,Str "contain",Space,Link [Str "links"] (Src "http://google.com" ""),Space,Str "and",Space,Code "]",Space,Str "verbatim",Space,Str "characters."] ]
338+ [ Para [Str "This",Space,Str "is",Space,Emph [Str "easier"],Space,Str "to",Space,Str "type",Str ".",Space,Str "Inline",Space,Str "notes",Space,Str "may",Space,Str "contain",Space,Link [Str "links"] (Src "http://google.com" ""),Space,Str "and",Space,Code "]",Space,Str "verbatim",Space,Str "characters",Str "."] ]
339339
340340, Note "4"
341− [ Para [Str "In",Space,Str "quote."] ]
341+ [ Para [Str "In",Space,Str "quote",Str "."] ]
342342
343343, Note "5"
344− [ Para [Str "In",Space,Str "list."] ]
344+ [ Para [Str "In",Space,Str "list",Str "."] ]
345345 ]
tests/writer.rst+2−2
@@ -501,11 +501,11 @@ Smart quotes, ellipses, dashes
501501
502502Here is some quoted '``code``' and a "`quoted link`_".
503503
504−Some dashes: one---two --- three--four -- five.
504+Some dashes: one--two--three--four--five.
505505
506506Dashes between numbers: 5-7, 255-66, 1987-1999.
507507
508−Ellipses...and. . .and . . . .
508+Ellipses...and...and....
509509
510510--------------
511511
tests/writer.rtf+28−28
@@ -6,7 +6,7 @@
66{\pard \f0 \sa180 \li0 \fi0 \qc John MacFarlane\Anonymous\par}
77{\pard \f0 \sa180 \li0 \fi0 \qc July 17, 2006\par}
88{\pard \f0 \sa180 \li0 \fi0 \par}
9−{\pard \f0 \sa180 \li0 \fi0 This is a set of tests for pandoc. Most of them are adapted from John Gruber's markdown test suite.\par}
9+{\pard \f0 \sa180 \li0 \fi0 This is a set of tests for pandoc. Most of them are adapted from John Gruber\u8217's markdown test suite.\par}
1010{\pard \f0 \sa180 \li0 \fi0 \qc \emdash\emdash\emdash\emdash\emdash\par}
1111{\pard \f0 \sa180 \li0 \fi0 \b \fs36 Headers\par}
1212{\pard \f0 \sa180 \li0 \fi0 \b \fs32 Level 2 with an {\field{\*\fldinst{HYPERLINK "/url"}}{\fldrslt{\ul
@@ -24,9 +24,9 @@ embedded link
2424{\pard \f0 \sa180 \li0 \fi0 with no blank line\par}
2525{\pard \f0 \sa180 \li0 \fi0 \qc \emdash\emdash\emdash\emdash\emdash\par}
2626{\pard \f0 \sa180 \li0 \fi0 \b \fs36 Paragraphs\par}
27−{\pard \f0 \sa180 \li0 \fi0 Here's a regular paragraph.\par}
27+{\pard \f0 \sa180 \li0 \fi0 Here\u8217's a regular paragraph.\par}
2828{\pard \f0 \sa180 \li0 \fi0 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.\par}
29−{\pard \f0 \sa180 \li0 \fi0 Here's one with a bullet. * criminey.\par}
29+{\pard \f0 \sa180 \li0 \fi0 Here\u8217's one with a bullet. * criminey.\par}
3030{\pard \f0 \sa180 \li0 \fi0 There should be a hard line break\line here.\par}
3131{\pard \f0 \sa180 \li0 \fi0 \qc \emdash\emdash\emdash\emdash\emdash\par}
3232{\pard \f0 \sa180 \li0 \fi0 \b \fs36 Block Quotes\par}
@@ -50,9 +50,9 @@ embedded link
5050\}\par}
5151{\pard \f0 \sa0 \li1080 \fi-360 1.\tx360\tab do laundry\par}
5252{\pard \f0 \sa0 \li1080 \fi-360 2.\tx360\tab take out the trash\sa180\par}
53−{\pard \f0 \sa180 \li0 \fi0 Here's a nested one:\par}
53+{\pard \f0 \sa180 \li0 \fi0 Here\u8217's a nested one:\par}
5454{\pard \f0 \sa180 \li720 \fi0 Joe said:\par}
55−{\pard \f0 \sa180 \li1440 \fi0 Don't quote me.\par}
55+{\pard \f0 \sa180 \li1440 \fi0 Don\u8217't quote me.\par}
5656{\pard \f0 \sa180 \li0 \fi0 And a following paragraph.\par}
5757{\pard \f0 \sa180 \li0 \fi0 \qc \emdash\emdash\emdash\emdash\emdash\par}
5858{\pard \f0 \sa180 \li0 \fi0 \b \fs36 Code Blocks\par}
@@ -114,14 +114,14 @@ These should not be escaped: \\$ \\\\ \\> \\[ \\\{\par}
114114{\pard \f0 \sa180 \li360 \fi-360 3.\tx360\tab Three\sa180\par}
115115{\pard \f0 \sa180 \li0 \fi0 Multiple paragraphs:\par}
116116{\pard \f0 \sa180 \li360 \fi-360 1.\tx360\tab Item 1, graf one.\par}
117−{\pard \f0 \sa180 \li360 \fi0 Item 1. graf two. The quick brown fox jumped over the lazy dog's back.\par}
117+{\pard \f0 \sa180 \li360 \fi0 Item 1. graf two. The quick brown fox jumped over the lazy dog\u8217's back.\par}
118118{\pard \f0 \sa180 \li360 \fi-360 2.\tx360\tab Item 2.\par}
119119{\pard \f0 \sa180 \li360 \fi-360 3.\tx360\tab Item 3.\sa180\par}
120120{\pard \f0 \sa180 \li0 \fi0 \b \fs32 Nested\par}
121121{\pard \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab Tab\par}
122122{\pard \f0 \sa0 \li720 \fi-360 \endash \tx360\tab Tab\par}
123123{\pard \f0 \sa0 \li1080 \fi-360 \bullet \tx360\tab Tab\sa180\sa180\sa180\par}
124−{\pard \f0 \sa180 \li0 \fi0 Here's another:\par}
124+{\pard \f0 \sa180 \li0 \fi0 Here\u8217's another:\par}
125125{\pard \f0 \sa0 \li360 \fi-360 1.\tx360\tab First\par}
126126{\pard \f0 \sa0 \li360 \fi-360 2.\tx360\tab Second:\par}
127127{\pard \f0 \sa0 \li720 \fi-360 \endash \tx360\tab Fee\par}
@@ -150,7 +150,7 @@ These should not be escaped: \\$ \\\\ \\> \\[ \\\{\par}
150150{\pard \f0 \sa180 \li0 \fi0 Interpreted markdown in a table:\par}
151151{\pard \f0 \sa0 \li0 \fi0 This is {\i emphasized} \par}
152152{\pard \f0 \sa0 \li0 \fi0 And this is {\b strong} \par}
153−{\pard \f0 \sa180 \li0 \fi0 Here's a simple block:\par}
153+{\pard \f0 \sa180 \li0 \fi0 Here\u8217's a simple block:\par}
154154{\pard \f0 \sa0 \li0 \fi0 foo\par}
155155{\pard \f0 \sa180 \li0 \fi0 This should be a code block, though:\par}
156156{\pard \f0 \sa180 \li0 \fi0 \f1 <div>\line
@@ -167,7 +167,7 @@ These should not be escaped: \\$ \\\\ \\> \\[ \\\{\par}
167167{\pard \f0 \sa180 \li0 \fi0 Just plain comment, with trailing spaces on the line:\par}
168168{\pard \f0 \sa180 \li0 \fi0 Code:\par}
169169{\pard \f0 \sa180 \li0 \fi0 \f1 <hr />\par}
170−{\pard \f0 \sa180 \li0 \fi0 Hr's:\par}
170+{\pard \f0 \sa180 \li0 \fi0 Hr\u8217's:\par}
171171{\pard \f0 \sa180 \li0 \fi0 \qc \emdash\emdash\emdash\emdash\emdash\par}
172172{\pard \f0 \sa180 \li0 \fi0 \b \fs36 Inline Markup\par}
173173{\pard \f0 \sa180 \li0 \fi0 This is {\i emphasized} , and so {\i is this} .\par}
@@ -183,17 +183,17 @@ emphasized link
183183{\pard \f0 \sa180 \li0 \fi0 This is code: {\f1 >} , {\f1 $} , {\f1 \\} , {\f1 \\$} , {\f1 <html>} .\par}
184184{\pard \f0 \sa180 \li0 \fi0 \qc \emdash\emdash\emdash\emdash\emdash\par}
185185{\pard \f0 \sa180 \li0 \fi0 \b \fs36 Smart quotes, ellipses, dashes\par}
186−{\pard \f0 \sa180 \li0 \fi0 "Hello," said the spider. "'Shelob' is my name."\par}
187−{\pard \f0 \sa180 \li0 \fi0 'A', 'B', and 'C' are letters.\par}
188−{\pard \f0 \sa180 \li0 \fi0 'Oak,' 'elm,' and 'beech' are names of trees. So is 'pine.'\par}
189−{\pard \f0 \sa180 \li0 \fi0 'He said, "I want to go."' Were you alive in the 70's?\par}
190−{\pard \f0 \sa180 \li0 \fi0 Here is some quoted '{\f1 code} ' and a "{\field{\*\fldinst{HYPERLINK "http://example.com/?foo=1&bar=2"}}{\fldrslt{\ul
186+{\pard \f0 \sa180 \li0 \fi0 \u8220"Hello,\u8221" said the spider. \u8220"\u8216'Shelob\u8217' is my name.\u8221"\par}
187+{\pard \f0 \sa180 \li0 \fi0 \u8216'A\u8217', \u8216'B\u8217', and \u8216'C\u8217' are letters.\par}
188+{\pard \f0 \sa180 \li0 \fi0 \u8216'Oak,\u8217' \u8216'elm,\u8217' and \u8216'beech\u8217' are names of trees. So is \u8216'pine.\u8217'\par}
189+{\pard \f0 \sa180 \li0 \fi0 \u8216'He said, \u8220"I want to go.\u8221"\u8217' Were you alive in the 70\u8217's?\par}
190+{\pard \f0 \sa180 \li0 \fi0 Here is some quoted \u8216'{\f1 code} \u8217' and a \u8220"{\field{\*\fldinst{HYPERLINK "http://example.com/?foo=1&bar=2"}}{\fldrslt{\ul
191191quoted link
192192}}}
193−".\par}
194−{\pard \f0 \sa180 \li0 \fi0 Some dashes: one---two --- three--four -- five.\par}
195−{\pard \f0 \sa180 \li0 \fi0 Dashes between numbers: 5-7, 255-66, 1987-1999.\par}
196−{\pard \f0 \sa180 \li0 \fi0 Ellipses...and. . .and . . . .\par}
193+\u8221".\par}
194+{\pard \f0 \sa180 \li0 \fi0 Some dashes: one\u8212-two\u8212-three\u8212-four\u8212-five.\par}
195+{\pard \f0 \sa180 \li0 \fi0 Dashes between numbers: 5\u8211-7, 255\u8211-66, 1987\u8211-1999.\par}
196+{\pard \f0 \sa180 \li0 \fi0 Ellipses\u8230?and\u8230?and\u8230?.\par}
197197{\pard \f0 \sa180 \li0 \fi0 \qc \emdash\emdash\emdash\emdash\emdash\par}
198198{\pard \f0 \sa180 \li0 \fi0 \b \fs36 LaTeX\par}
199199{\pard \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab {\cf1 \\cite[22-23]\{smith.1899\}\cf0 } \par}
@@ -204,12 +204,12 @@ quoted link
204204{\pard \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab {\cf1 $223$\cf0 } \par}
205205{\pard \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab {\cf1 $p$\cf0 } -Tree\par}
206206{\pard \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab {\cf1 $\\frac\{d\}\{dx\}f(x)=\\lim_\{h\\to 0\}\\frac\{f(x+h)-f(x)\}\{h\}$\cf0 } \par}
207−{\pard \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab Here's one that has a line break in it: {\cf1 $\\alpha + \\omega \\times x^2$\cf0 } .\sa180\par}
208−{\pard \f0 \sa180 \li0 \fi0 These shouldn't be math:\par}
207+{\pard \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab Here\u8217's one that has a line break in it: {\cf1 $\\alpha + \\omega \\times x^2$\cf0 } .\sa180\par}
208+{\pard \f0 \sa180 \li0 \fi0 These shouldn\u8217't be math:\par}
209209{\pard \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab To get the famous equation, write {\f1 $e = mc^2$} .\par}
210−{\pard \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab $22,000 is a {\i lot} of money. So is $34,000. (It worked if "lot" is emphasized.)\par}
210+{\pard \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab $22,000 is a {\i lot} of money. So is $34,000. (It worked if \u8220"lot\u8221" is emphasized.)\par}
211211{\pard \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab Escaped {\f1 $} : $73 {\i this should be emphasized} 23$.\sa180\par}
212−{\pard \f0 \sa180 \li0 \fi0 Here's a LaTeX table:\par}
212+{\pard \f0 \sa180 \li0 \fi0 Here\u8217's a LaTeX table:\par}
213213{\pard \f0 \sa180 \li0 \fi0 {\cf1 \\begin\{tabular\}\{|l|l|\}\\hline
214214Animal & Number \\\\ \\hline
215215Dog & 2 \\\\
@@ -323,19 +323,19 @@ biz
323323}}}
324324.\par}
325325{\pard \f0 \sa180 \li0 \fi0 \b \fs32 With ampersands\par}
326−{\pard \f0 \sa180 \li0 \fi0 Here's a {\field{\*\fldinst{HYPERLINK "http://example.com/?foo=1&bar=2"}}{\fldrslt{\ul
326+{\pard \f0 \sa180 \li0 \fi0 Here\u8217's a {\field{\*\fldinst{HYPERLINK "http://example.com/?foo=1&bar=2"}}{\fldrslt{\ul
327327link with an ampersand in the URL
328328}}}
329329.\par}
330−{\pard \f0 \sa180 \li0 \fi0 Here's a link with an amersand in the link text: {\field{\*\fldinst{HYPERLINK "http://att.com/"}}{\fldrslt{\ul
330+{\pard \f0 \sa180 \li0 \fi0 Here\u8217's a link with an amersand in the link text: {\field{\*\fldinst{HYPERLINK "http://att.com/"}}{\fldrslt{\ul
331331AT&T
332332}}}
333333.\par}
334−{\pard \f0 \sa180 \li0 \fi0 Here's an {\field{\*\fldinst{HYPERLINK "/script?foo=1&bar=2"}}{\fldrslt{\ul
334+{\pard \f0 \sa180 \li0 \fi0 Here\u8217's an {\field{\*\fldinst{HYPERLINK "/script?foo=1&bar=2"}}{\fldrslt{\ul
335335inline link
336336}}}
337337.\par}
338−{\pard \f0 \sa180 \li0 \fi0 Here's an {\field{\*\fldinst{HYPERLINK "/script?foo=1&bar=2"}}{\fldrslt{\ul
338+{\pard \f0 \sa180 \li0 \fi0 Here\u8217's an {\field{\*\fldinst{HYPERLINK "/script?foo=1&bar=2"}}{\fldrslt{\ul
339339inline link in pointy braces
340340}}}
341341.\par}
@@ -362,13 +362,13 @@ http://example.com/
362362{\pard \f0 \sa180 \li0 \fi0 \f1 or here: <http://example.com/>\par}
363363{\pard \f0 \sa180 \li0 \fi0 \qc \emdash\emdash\emdash\emdash\emdash\par}
364364{\pard \f0 \sa180 \li0 \fi0 \b \fs36 Images\par}
365−{\pard \f0 \sa180 \li0 \fi0 From "Voyage dans la Lune" by Georges Melies (1902):\par}
365+{\pard \f0 \sa180 \li0 \fi0 From \u8220"Voyage dans la Lune\u8221" by Georges Melies (1902):\par}
366366{\pard \f0 \sa180 \li0 \fi0 {\cf1 [image: lalune.jpg]\cf0}\par}
367367{\pard \f0 \sa180 \li0 \fi0 Here is a movie {\cf1 [image: movie.jpg]\cf0} icon.\par}
368368{\pard \f0 \sa180 \li0 \fi0 \qc \emdash\emdash\emdash\emdash\emdash\par}
369369{\pard \f0 \sa180 \li0 \fi0 \b \fs36 Footnotes\par}
370370{\pard \f0 \sa180 \li0 \fi0 Here is a footnote reference,{\super\chftn}{\*\footnote\chftn\~\plain\pard {\pard \f0 \sa180 \li0 \fi0 Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.\par}
371−} and another.{\super\chftn}{\*\footnote\chftn\~\plain\pard {\pard \f0 \sa180 \li0 \fi0 Here's the long note. This one contains multiple blocks.\par}
371+} and another.{\super\chftn}{\*\footnote\chftn\~\plain\pard {\pard \f0 \sa180 \li0 \fi0 Here\u8217's the long note. This one contains multiple blocks.\par}
372372{\pard \f0 \sa180 \li0 \fi0 Subsequent blocks are indented to show that they belong to the footnote (as with list items).\par}
373373{\pard \f0 \sa180 \li0 \fi0 \f1 \{ <code> \}\par}
374374{\pard \f0 \sa180 \li0 \fi0 If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.\par}
tests/writer.smart.htmldeleted−474
@@ -1,474 +0,0 @@
1−<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2− "http://www.w3.org/TR/html4/loose.dtd">
3−<html>
4−<head>
5−<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
6−<meta name="generator" content="pandoc" />
7−<meta name="author" content="John MacFarlane, Anonymous" />
8−<meta name="date" content="July 17, 2006" />
9−<title>Pandoc Test Suite</title>
10−</head>
11−<body>
12−<h1 class="title">Pandoc Test Suite</h1>
13−<p>This is a set of tests for pandoc. Most of them are adapted from John Gruber&rsquo;s markdown test suite.</p>
14−<hr />
15−<h1>Headers</h1>
16−<h2>Level 2 with an <a href="/url">embedded link</a></h2>
17−<h3>Level 3 with <em>emphasis</em></h3>
18−<h4>Level 4</h4>
19−<h5>Level 5</h5>
20−<h1>Level 1</h1>
21−<h2>Level 2 with <em>emphasis</em></h2>
22−<h3>Level 3</h3>
23−<p>with no blank line</p>
24−<h2>Level 2</h2>
25−<p>with no blank line</p>
26−<hr />
27−<h1>Paragraphs</h1>
28−<p>Here&rsquo;s a regular paragraph.</p>
29−<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>
30−<p>Here&rsquo;s one with a bullet. * criminey.</p>
31−<p>There should be a hard line break<br />
32−here.</p>
33−<hr />
34−<h1>Block Quotes</h1>
35−<p>E-mail style:</p>
36−<blockquote>
37−<p>This is a block quote. It is pretty short.</p>
38−</blockquote>
39−<blockquote>
40−<p>Code in a block quote:</p>
41−<pre><code>sub status {
42− print &quot;working&quot;;
43−}
44−</code></pre>
45−<p>A list:</p>
46−<ol>
47−<li>item one</li>
48−<li>item two</li>
49−</ol>
50−<p>Nested block quotes:</p>
51−<blockquote>
52−<p>nested</p>
53−</blockquote>
54−<blockquote>
55−<p>nested</p>
56−</blockquote>
57−</blockquote>
58−<p>This should not be a block quote: 2 &gt; 1.</p>
59−<p>Box-style:</p>
60−<blockquote>
61−<p>Example:</p>
62−<pre><code>sub status {
63− print &quot;working&quot;;
64−}
65−</code></pre>
66−</blockquote>
67−<blockquote>
68−<ol>
69−<li>do laundry</li>
70−<li>take out the trash</li>
71−</ol>
72−</blockquote>
73−<p>Here&rsquo;s a nested one:</p>
74−<blockquote>
75−<p>Joe said:</p>
76−<blockquote>
77−<p>Don&rsquo;t quote me.</p>
78−</blockquote>
79−</blockquote>
80−<p>And a following paragraph.</p>
81−<hr />
82−<h1>Code Blocks</h1>
83−<p>Code:</p>
84−<pre><code>---- (should be four hyphens)
85−
86−sub status {
87− print &quot;working&quot;;
88−}
89−
90−this code block is indented by one tab
91−</code></pre>
92−<p>And:</p>
93−<pre><code> this code block is indented by two tabs
94−
95−These should not be escaped: \$ \\ \&gt; \[ \{
96−</code></pre>
97−<hr />
98−<h1>Lists</h1>
99−<h2>Unordered</h2>
100−<p>Asterisks tight:</p>
101−<ul>
102−<li>asterisk 1</li>
103−<li>asterisk 2</li>
104−<li>asterisk 3</li>
105−</ul>
106−<p>Asterisks loose:</p>
107−<ul>
108−<li><p>asterisk 1</p>
109−</li>
110−<li><p>asterisk 2</p>
111−</li>
112−<li><p>asterisk 3</p>
113−</li>
114−</ul>
115−<p>Pluses tight:</p>
116−<ul>
117−<li>Plus 1</li>
118−<li>Plus 2</li>
119−<li>Plus 3</li>
120−</ul>
121−<p>Pluses loose:</p>
122−<ul>
123−<li><p>Plus 1</p>
124−</li>
125−<li><p>Plus 2</p>
126−</li>
127−<li><p>Plus 3</p>
128−</li>
129−</ul>
130−<p>Minuses tight:</p>
131−<ul>
132−<li>Minus 1</li>
133−<li>Minus 2</li>
134−<li>Minus 3</li>
135−</ul>
136−<p>Minuses loose:</p>
137−<ul>
138−<li><p>Minus 1</p>
139−</li>
140−<li><p>Minus 2</p>
141−</li>
142−<li><p>Minus 3</p>
143−</li>
144−</ul>
145−<h2>Ordered</h2>
146−<p>Tight:</p>
147−<ol>
148−<li>First</li>
149−<li>Second</li>
150−<li>Third</li>
151−</ol>
152−<p>and:</p>
153−<ol>
154−<li>One</li>
155−<li>Two</li>
156−<li>Three</li>
157−</ol>
158−<p>Loose using tabs:</p>
159−<ol>
160−<li><p>First</p>
161−</li>
162−<li><p>Second</p>
163−</li>
164−<li><p>Third</p>
165−</li>
166−</ol>
167−<p>and using spaces:</p>
168−<ol>
169−<li><p>One</p>
170−</li>
171−<li><p>Two</p>
172−</li>
173−<li><p>Three</p>
174−</li>
175−</ol>
176−<p>Multiple paragraphs:</p>
177−<ol>
178−<li><p>Item 1, graf one.</p>
179−<p>Item 1. graf two. The quick brown fox jumped over the lazy dog&rsquo;s back.</p>
180−</li>
181−<li><p>Item 2.</p>
182−</li>
183−<li><p>Item 3.</p>
184−</li>
185−</ol>
186−<h2>Nested</h2>
187−<ul>
188−<li>Tab<ul>
189−<li>Tab<ul>
190−<li>Tab</li>
191−</ul>
192−</li>
193−</ul>
194−</li>
195−</ul>
196−<p>Here&rsquo;s another:</p>
197−<ol>
198−<li>First</li>
199−<li>Second:<ul>
200−<li>Fee</li>
201−<li>Fie</li>
202−<li>Foe</li>
203−</ul>
204−</li>
205−<li>Third</li>
206−</ol>
207−<p>Same thing but with paragraphs:</p>
208−<ol>
209−<li><p>First</p>
210−</li>
211−<li><p>Second:</p>
212−<ul>
213−<li>Fee</li>
214−<li>Fie</li>
215−<li>Foe</li>
216−</ul>
217−</li>
218−<li><p>Third</p>
219−</li>
220−</ol>
221−<h2>Tabs and spaces</h2>
222−<ul>
223−<li><p>this is a list item indented with tabs</p>
224−</li>
225−<li><p>this is a list item indented with spaces</p>
226−<ul>
227−<li><p>this is an example list item indented with tabs</p>
228−</li>
229−<li><p>this is an example list item indented with spaces</p>
230−</li>
231−</ul>
232−</li>
233−</ul>
234−<hr />
235−<h1>HTML Blocks</h1>
236−<p>Simple block on one line:</p>
237−<div>foo</div>
238−<p>And nested without indentation:</p>
239−<div>
240−<div>
241−<div>foo</div>
242−</div>
243−<div>bar</div>
244−</div>
245−<p>Interpreted markdown in a table:</p>
246−<table>
247−<tr>
248−<td>This is <em>emphasized</em></td>
249−<td>And this is <strong>strong</strong></td>
250−</tr>
251−</table>
252−
253−<script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script>
254−<p>Here&rsquo;s a simple block:</p>
255−<div>
256− foo</div>
257−<p>This should be a code block, though:</p>
258−<pre><code>&lt;div&gt;
259− foo
260−&lt;/div&gt;
261−</code></pre>
262−<p>As should this:</p>
263−<pre><code>&lt;div&gt;foo&lt;/div&gt;
264−</code></pre>
265−<p>Now, nested:</p>
266−<div>
267− <div>
268− <div>
269− foo</div>
270− </div>
271−</div>
272−<p>This should just be an HTML comment:</p>
273−<!-- Comment -->
274−<p>Multiline:</p>
275−<!--
276−Blah
277−Blah
278−-->
279−
280−<!--
281− This is another comment.
282−-->
283−<p>Code block:</p>
284−<pre><code>&lt;!-- Comment --&gt;
285−</code></pre>
286−<p>Just plain comment, with trailing spaces on the line:</p>
287−<!-- foo -->
288−<p>Code:</p>
289−<pre><code>&lt;hr /&gt;
290−</code></pre>
291−<p>Hr&rsquo;s:</p>
292−<hr>
293−
294−<hr />
295−
296−<hr />
297−
298−<hr>
299−
300−<hr />
301−
302−<hr />
303−
304−<hr class="foo" id="bar" />
305−
306−<hr class="foo" id="bar" />
307−
308−<hr class="foo" id="bar">
309−<hr />
310−<h1>Inline Markup</h1>
311−<p>This is <em>emphasized</em>, and so <em>is this</em>.</p>
312−<p>This is <strong>strong</strong>, and so <strong>is this</strong>.</p>
313−<p>An <em><a href="/url">emphasized link</a></em>.</p>
314−<p><strong><em>This is strong and em.</em></strong></p>
315−<p>So is <strong><em>this</em></strong> word.</p>
316−<p><strong><em>This is strong and em.</em></strong></p>
317−<p>So is <strong><em>this</em></strong> word.</p>
318−<p>This is code: <code>&gt;</code>, <code>$</code>, <code>\</code>, <code>\$</code>, <code>&lt;html&gt;</code>.</p>
319−<hr />
320−<h1>Smart quotes, ellipses, dashes</h1>
321−<p>&ldquo;Hello,&rdquo; said the spider. &ldquo;&lsquo;Shelob&rsquo; is my name.&rdquo;</p>
322−<p>&lsquo;A&rsquo;, &lsquo;B&rsquo;, and &lsquo;C&rsquo; are letters.</p>
323−<p>&lsquo;Oak,&rsquo; &lsquo;elm,&rsquo; and &lsquo;beech&rsquo; are names of trees. So is &lsquo;pine.&rsquo;</p>
324−<p>&lsquo;He said, &ldquo;I want to go.&rdquo;&rsquo; Were you alive in the 70&rsquo;s?</p>
325−<p>Here is some quoted &lsquo;<code>code</code>&rsquo; and a &ldquo;<a href="http://example.com/?foo=1&amp;bar=2">quoted link</a>&rdquo;.</p>
326−<p>Some dashes: one&mdash;two&mdash;three&mdash;four&mdash;five.</p>
327−<p>Dashes between numbers: 5&ndash;7, 255&ndash;66, 1987&ndash;1999.</p>
328−<p>Ellipses&hellip;and&hellip;and &hellip; .</p>
329−<hr />
330−<h1>LaTeX</h1>
331−<ul>
332−<li>\cite[22-23]{smith.1899}</li>
333−<li>\doublespacing</li>
334−<li>$2+2=4$</li>
335−<li>$x \in y$</li>
336−<li>$\alpha \wedge \omega$</li>
337−<li>$223$</li>
338−<li>$p$-Tree</li>
339−<li>$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</li>
340−<li>Here&rsquo;s one that has a line break in it: $\alpha + \omega \times x^2$.</li>
341−</ul>
342−<p>These shouldn&rsquo;t be math:</p>
343−<ul>
344−<li>To get the famous equation, write <code>$e = mc^2$</code>.</li>
345−<li>$22,000 is a <em>lot</em> of money. So is $34,000. (It worked if &ldquo;lot&rdquo; is emphasized.)</li>
346−<li>Escaped <code>$</code>: $73 <em>this should be emphasized</em> 23$.</li>
347−</ul>
348−<p>Here&rsquo;s a LaTeX table:</p>
349−<p>\begin{tabular}{|l|l|}\hline
350−Animal &amp; Number \\ \hline
351−Dog &amp; 2 \\
352−Cat &amp; 1 \\ \hline
353−\end{tabular}</p>
354−<hr />
355−<h1>Special Characters</h1>
356−<p>Here is some unicode:</p>
357−<ul>
358−<li>I hat: &Icirc;</li>
359−<li>o umlaut: &ouml;</li>
360−<li>section: &sect;</li>
361−<li>set membership: &isin;</li>
362−<li>copyright: &copy;</li>
363−</ul>
364−<p>AT&amp;T has an ampersand in their name.</p>
365−<p>AT&amp;T is another way to write it.</p>
366−<p>This &amp; that.</p>
367−<p>4 &lt; 5.</p>
368−<p>6 &gt; 5.</p>
369−<p>Backslash: \</p>
370−<p>Backtick: &lsquo;</p>
371−<p>Asterisk: *</p>
372−<p>Underscore: _</p>
373−<p>Left brace: {</p>
374−<p>Right brace: }</p>
375−<p>Left bracket: [</p>
376−<p>Right bracket: ]</p>
377−<p>Left paren: (</p>
378−<p>Right paren: )</p>
379−<p>Greater-than: &gt;</p>
380−<p>Hash: #</p>
381−<p>Period: .</p>
382−<p>Bang: !</p>
383−<p>Plus: +</p>
384−<p>Minus: -</p>
385−<hr />
386−<h1>Links</h1>
387−<h2>Explicit</h2>
388−<p>Just a <a href="/url/">URL</a>.</p>
389−<p><a href="/url/" title="title">URL and title</a>.</p>
390−<p><a href="/url/" title="title preceded by two spaces">URL and title</a>.</p>
391−<p><a href="/url/" title="title preceded by a tab">URL and title</a>.</p>
392−<p><a href="/url/" title="title with &ldquo;quotes&rdquo; in it">URL and title</a></p>
393−<p><a href="/url/" title="title with single quotes">URL and title</a></p>
394−<p><script type="text/javascript">
395−<!--
396−h='&#110;&#x6f;&#x77;&#104;&#x65;&#114;&#x65;&#46;&#110;&#x65;&#116;';a='&#64;';n='&#110;&#x6f;&#98;&#x6f;&#100;&#x79;';e=n+a+h;
397−document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'Email link'+'<\/'+'a'+'>');
398−// -->
399−</script><noscript>&#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></p>
400−<p><a href="">Empty</a>.</p>
401−<h2>Reference</h2>
402−<p>Foo <a href="/url/">bar</a>.</p>
403−<p>Foo <a href="/url/">bar</a>.</p>
404−<p>Foo <a href="/url/">bar</a>.</p>
405−<p>With <a href="/url/">embedded [brackets]</a>.</p>
406−<p><a href="/url/">b</a> by itself should be a link.</p>
407−<p>Indented <a href="/url">once</a>.</p>
408−<p>Indented <a href="/url">twice</a>.</p>
409−<p>Indented <a href="/url">thrice</a>.</p>
410−<p>This should [not][] be a link.</p>
411−<pre><code>[not]: /url
412−</code></pre>
413−<p>Foo <a href="/url/" title="Title with &ldquo;quotes&rdquo; inside">bar</a>.</p>
414−<p>Foo <a href="/url/" title="Title with &ldquo;quote&rdquo; inside">biz</a>.</p>
415−<h2>With ampersands</h2>
416−<p>Here&rsquo;s a <a href="http://example.com/?foo=1&amp;bar=2">link with an ampersand in the URL</a>.</p>
417−<p>Here&rsquo;s a link with an amersand in the link text: <a href="http://att.com/" title="AT&amp;T">AT&amp;T</a>.</p>
418−<p>Here&rsquo;s an <a href="/script?foo=1&amp;bar=2">inline link</a>.</p>
419−<p>Here&rsquo;s an <a href="/script?foo=1&amp;bar=2">inline link in pointy braces</a>.</p>
420−<h2>Autolinks</h2>
421−<p>With an ampersand: <a href="http://example.com/?foo=1&amp;bar=2">http://example.com/?foo=1&amp;bar=2</a></p>
422−<ul>
423−<li>In a list?</li>
424−<li><a href="http://example.com/">http://example.com/</a></li>
425−<li>It should.</li>
426−</ul>
427−<p>An e-mail address: <script type="text/javascript">
428−<!--
429−h='&#110;&#x6f;&#x77;&#104;&#x65;&#114;&#x65;&#46;&#110;&#x65;&#116;';a='&#64;';n='&#110;&#x6f;&#98;&#x6f;&#100;&#x79;';e=n+a+h;
430−document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+e+'<\/'+'a'+'>');
431−// -->
432−</script><noscript>&#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></p>
433−<blockquote>
434−<p>Blockquoted: <a href="http://example.com/">http://example.com/</a></p>
435−</blockquote>
436−<p>Auto-links should not occur here: <code>&lt;http://example.com/&gt;</code></p>
437−<pre><code>or here: &lt;http://example.com/&gt;
438−</code></pre>
439−<hr />
440−<h1>Images</h1>
441−<p>From &ldquo;Voyage dans la Lune&rdquo; by Georges Melies (1902):</p>
442−<p><img src="lalune.jpg" title="Voyage dans la Lune" alt="lalune"></p>
443−<p>Here is a movie <img src="movie.jpg" alt="movie"> icon.</p>
444−<hr />
445−<h1>Footnotes</h1>
446−<p>Here is a footnote reference,<sup class="footnoteRef" id="fnref1"><a href="#fn1">1</a></sup> and another.<sup class="footnoteRef" id="fnref2"><a href="#fn2">2</a></sup> This should <em>not</em> be a footnote reference, because it contains a space.[^my note] Here is an inline note.<sup class="footnoteRef" id="fnref3"><a href="#fn3">3</a></sup></p>
447−<blockquote>
448−<p>Notes can go in quotes.<sup class="footnoteRef" id="fnref4"><a href="#fn4">4</a></sup></p>
449−</blockquote>
450−<ol>
451−<li>And in list items.<sup class="footnoteRef" id="fnref5"><a href="#fn5">5</a></sup></li>
452−</ol>
453−<p>This paragraph should not be part of the note, as it is not indented.</p>
454−<div class="footnotes">
455−<hr />
456−<ol>
457−<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.</p>
458− <a href="#fnref1" class="footnoteBacklink" title="Jump back to footnote 1">&#8617;</a></li>
459−<li id="fn2"><p>Here&rsquo;s the long note. This one contains multiple blocks.</p>
460−<p>Subsequent blocks are indented to show that they belong to the footnote (as with list items).</p>
461−<pre><code> { &lt;code&gt; }
462−</code></pre>
463−<p>If you want, you can indent every line, but you can also be lazy and just indent the first line of each block.</p>
464− <a href="#fnref2" class="footnoteBacklink" title="Jump back to footnote 2">&#8617;</a></li>
465−<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.</p>
466− <a href="#fnref3" class="footnoteBacklink" title="Jump back to footnote 3">&#8617;</a></li>
467−<li id="fn4"><p>In quote.</p>
468− <a href="#fnref4" class="footnoteBacklink" title="Jump back to footnote 4">&#8617;</a></li>
469−<li id="fn5"><p>In list.</p>
470− <a href="#fnref5" class="footnoteBacklink" title="Jump back to footnote 5">&#8617;</a></li>
471−</ol>
472−</div>
473−</body>
474−</html>