diff options
author | dr@jones.dk <dr@jones.dk> | 2011-02-07 03:28:57 +0100 |
---|---|---|
committer | dr@jones.dk <dr@jones.dk> | 2011-02-07 03:28:57 +0100 |
commit | b880b82b7f4b7c50d79f015eaf635f4b3bd8a1a3 (patch) | |
tree | f0bffd00ed41dbe294c71449c02b86d1738fe044 | |
parent | 91179df4907bec919e0884019da785be1ceb01b3 (diff) |
Imported Upstream version 1.8.0.3
-rw-r--r-- | README | 58 | ||||
-rw-r--r-- | Setup.hs | 2 | ||||
-rw-r--r-- | changelog | 36 | ||||
-rw-r--r-- | man/man1/pandoc.1 | 18 | ||||
-rw-r--r-- | man/man5/pandoc_markdown.5 | 42 | ||||
-rw-r--r-- | pandoc.cabal | 10 | ||||
-rw-r--r-- | src/Tests/Arbitrary.hs | 77 | ||||
-rw-r--r-- | src/Tests/Readers/Markdown.hs | 26 | ||||
-rw-r--r-- | src/Tests/Shared.hs | 5 | ||||
-rw-r--r-- | src/Tests/Writers/HTML.hs | 5 | ||||
-rw-r--r-- | src/Tests/Writers/Native.hs | 5 | ||||
-rw-r--r-- | src/Text/Pandoc/Readers/Markdown.hs | 16 | ||||
-rw-r--r-- | src/Text/Pandoc/Shared.hs | 18 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 141 | ||||
-rw-r--r-- | src/markdown2pdf.hs | 2 | ||||
-rw-r--r-- | tests/lhs-test.fragment.html+lhs | 65 | ||||
-rw-r--r-- | tests/lhs-test.html | 60 | ||||
-rw-r--r-- | tests/lhs-test.html+lhs | 60 | ||||
-rw-r--r-- | tests/lhs-test.nohl.html | 58 | ||||
-rw-r--r-- | tests/lhs-test.nohl.html+lhs | 58 | ||||
-rw-r--r-- | tests/s5.basic.html | 32 | ||||
-rw-r--r-- | tests/s5.fancy.html | 38 | ||||
-rw-r--r-- | tests/s5.fragment.html | 26 | ||||
-rw-r--r-- | tests/s5.inserts.html | 26 | ||||
-rw-r--r-- | tests/tables.html | 499 | ||||
-rw-r--r-- | tests/writer.html | 1599 |
26 files changed, 1177 insertions, 1805 deletions
@@ -216,7 +216,7 @@ Options : Produce HTML5 instead of HTML4. This option has no effect for writers other than `html`. -`-m` *URL*, `--latexmathml=`*URL* +`-m` [*URL*], `--latexmathml`[=*URL*] : Use the [LaTeXMathML] script to display embedded TeX math in HTML output. To insert a link to a local copy of the `LaTeXMathML.js` script, provide a *URL*. If no *URL* is provided, the contents of the @@ -225,15 +225,18 @@ Options several pages, it is much better to link to a copy of the script, so it can be cached. -`--mathml` +`--mathml`[=*URL*] : Convert TeX math to MathML. In standalone mode, a small javascript - will be inserted that allows the MathML to be viewed on some browsers. + (or a link to such a script if a *URL* is supplied) will be inserted that + allows the MathML to be viewed on some browsers. -`--jsmath=`*URL* +`--jsmath`[=*URL*] : Use [jsMath] to display embedded TeX math in HTML output. The *URL* should point to the jsMath load script (e.g. `jsMath/easy/load.js`); if provided, it will be linked to in - the header of standalone HTML documents. + the header of standalone HTML documents. If a *URL* is not provided, + no link to the jsMath load script will be inserted; it is then + up to the author to provide such a link in the HTML template. `--mathjax=`*URL* : Use [MathJax] to display embedded TeX math in HTML output. @@ -244,11 +247,11 @@ Options be processed by [gladTeX] to produce links to images of the typeset formulas. -`--mimetex=`*URL* +`--mimetex`[=*URL*] : Render TeX math using the [mimeTeX] CGI script. If *URL* is not specified, it is assumed that the script is at `/cgi-bin/mimetex.cgi`. -`--webtex=`*URL* +`--webtex`[=*URL*] : Render TeX formulas using an external script that converts TeX formulas to images. The formula will be concatenated with the URL provided. If *URL* is not specified, the Google Chart API will be used. @@ -827,10 +830,25 @@ The bullets need not be flush with the left margin; they may be indented one, two, or three spaces. The bullet must be followed by whitespace. +List items look best if subsequent lines are flush with the first +line (after the bullet): + + * here is my first + list item. + * and my second. + +But markdown also allows a "lazy" format: + + * here is my first + list item. + * and my second. + +### The four-space rule ### + A list item may contain multiple paragraphs and other block-level -content. Subsequent paragraphs must be preceded by a blank line -and indented four spaces or a tab. The list will look better if -the first paragraph is aligned with the rest: +content. However, subsequent paragraphs must be preceded by a blank line +and indented four spaces or a tab. The list will look better if the first +paragraph is aligned with the rest: * First paragraph. @@ -855,9 +873,9 @@ one tab: + brocolli + chard -Markdown allows you to write list items "lazily," instead of -indenting continuation lines. However, if there are multiple paragraphs -or other blocks in a list item, the first line of each must be indented. +As noted above, markdown allows you to write list items "lazily," instead of +indenting continuation lines. However, if there are multiple paragraphs or +other blocks in a list item, the first line of each must be indented. + A lazy, lazy, list item. @@ -868,6 +886,20 @@ or other blocks in a list item, the first line of each must be indented. Second paragraph of second list item. +**Note:** Although the four-space rule for continuation paragraphs +comes from the official [markdown syntax guide], the reference implementation, +`Markdown.pl`, does not follow it. So pandoc will give different results than +`Markdown.pl` when authors have indented continuation paragraphs fewer than +four spaces. + +The [markdown syntax guide] is not explicit whether the four-space +rule applies to *all* block-level content in a list item; it only +mentions paragraphs and code blocks. But it implies that the rule +applies to all block-level content (including nested lists), and +pandoc interprets it that way. + + [markdown syntax guide]: + http://daringfireball.net/projects/markdown/syntax#list ### Ordered lists ### @@ -40,7 +40,7 @@ runTestSuite :: Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO a runTestSuite args _ pkg lbi = do let testDir = buildDir lbi </> "test-pandoc" testDir' <- canonicalizePath testDir - let testArgs = concatMap (\arg -> ["-t",arg]) args + let testArgs = "--timeout=5" : concatMap (\arg -> ["-t",arg]) args if any id [buildable (buildInfo exe) | exe <- executables pkg, exeName exe == "test-pandoc"] then inDirectory "tests" $ rawSystem (testDir' </> "test-pandoc") testArgs >>= exitWith else do @@ -1,4 +1,38 @@ -pando (1.8.0.1) +pandoc (1.8.0.3) + + * Fixed Source-repository stanza in cabal file. + +pandoc (1.8.0.2) + + * HTML writer: + + + Stringify alt text instead of converting to HTML. + + Break lines after block elements, not inside tags. + HTML output now closely resembles that of tidy. Resolves Issue #134. + + * Markdown reader: Fixed bug in footnote block parser (pointed out + by Jesse Rosenthal). The problem arose when the blank line + at the end of a footnote block contained indenting spaces. + + * Shared: Improved 'normalize' function so it normalizes Spaces too. + In normal form, Space elements only occur to separate two non-Space + elements. So, we never have [Space], or [, ..., Space]. + + * Tests: + + + Improved Arbitrary instance. + + Added timeout for test instances. + + * README: + + + Added section on four-space rule for lists. Resolves Issue #283. + + Clarified optional arguments on math options. + + * markdown2pdf: Fixed bug with output file extensions. + Previously `markdown2pdf test.txt -o test.en.pdf` would produce + `test.pdf`, not `test.en.pdf`. Thanks to Paolo Tanimoto for the fix. + +pandoc (1.8.0.1) * Revised Interact.hs so that it works with the CPP macros in the UTF8 module. diff --git a/man/man1/pandoc.1 b/man/man1/pandoc.1 index a9fcfb08d..8ec58dd9a 100644 --- a/man/man1/pandoc.1 +++ b/man/man1/pandoc.1 @@ -232,7 +232,7 @@ This option has no effect for writers other than \f[C]html\f[]. .RS .RE .TP -.B \f[C]-m\f[] \f[I]URL\f[], \f[C]--latexmathml=\f[]\f[I]URL\f[] +.B \f[C]-m\f[] [\f[I]URL\f[]], \f[C]--latexmathml\f[][=\f[I]URL\f[]] Use the LaTeXMathML script to display embedded TeX math in HTML output. To insert a link to a local copy of the \f[C]LaTeXMathML.js\f[] script, provide a \f[I]URL\f[]. @@ -244,18 +244,22 @@ copy of the script, so it can be cached. .RS .RE .TP -.B \f[C]--mathml\f[] +.B \f[C]--mathml\f[][=\f[I]URL\f[]] Convert TeX math to MathML. -In standalone mode, a small javascript will be inserted that allows the -MathML to be viewed on some browsers. +In standalone mode, a small javascript (or a link to such a script if a +\f[I]URL\f[] is supplied) will be inserted that allows the MathML to be +viewed on some browsers. .RS .RE .TP -.B \f[C]--jsmath=\f[]\f[I]URL\f[] +.B \f[C]--jsmath\f[][=\f[I]URL\f[]] Use jsMath to display embedded TeX math in HTML output. The \f[I]URL\f[] should point to the jsMath load script (e.g. \f[C]jsMath/easy/load.js\f[]); if provided, it will be linked to in the header of standalone HTML documents. +If a \f[I]URL\f[] is not provided, no link to the jsMath load script +will be inserted; it is then up to the author to provide such a link in +the HTML template. .RS .RE .TP @@ -272,14 +276,14 @@ typeset formulas. .RS .RE .TP -.B \f[C]--mimetex=\f[]\f[I]URL\f[] +.B \f[C]--mimetex\f[][=\f[I]URL\f[]] Render TeX math using the mimeTeX CGI script. If \f[I]URL\f[] is not specified, it is assumed that the script is at \f[C]/cgi-bin/mimetex.cgi\f[]. .RS .RE .TP -.B \f[C]--webtex=\f[]\f[I]URL\f[] +.B \f[C]--webtex\f[][=\f[I]URL\f[]] Render TeX formulas using an external script that converts TeX formulas to images. The formula will be concatenated with the URL provided. diff --git a/man/man5/pandoc_markdown.5 b/man/man5/pandoc_markdown.5 index 1b5c483c1..069f02183 100644 --- a/man/man5/pandoc_markdown.5 +++ b/man/man5/pandoc_markdown.5 @@ -372,10 +372,32 @@ The bullets need not be flush with the left margin; they may be indented one, two, or three spaces. The bullet must be followed by whitespace. .PP +List items look best if subsequent lines are flush with the first line +(after the bullet): +.IP +.nf +\f[C] +*\ here\ is\ my\ first +\ \ list\ item. +*\ and\ my\ second. +\f[] +.fi +.PP +But markdown also allows a "lazy" format: +.IP +.nf +\f[C] +*\ here\ is\ my\ first +list\ item. +*\ and\ my\ second. +\f[] +.fi +.SS The four-space rule +.PP A list item may contain multiple paragraphs and other block-level content. -Subsequent paragraphs must be preceded by a blank line and indented four -spaces or a tab. +However, subsequent paragraphs must be preceded by a blank line and +indented four spaces or a tab. The list will look better if the first paragraph is aligned with the rest: .IP @@ -410,8 +432,8 @@ The nested list must be indented four spaces or one tab: \f[] .fi .PP -Markdown allows you to write list items "lazily," instead of indenting -continuation lines. +As noted above, markdown allows you to write list items "lazily," +instead of indenting continuation lines. However, if there are multiple paragraphs or other blocks in a list item, the first line of each must be indented. .IP @@ -427,6 +449,18 @@ bad\ but\ is\ legal. list\ item. \f[] .fi +.PP +\f[B]Note:\f[] Although the four-space rule for continuation paragraphs +comes from the official markdown syntax guide, the reference +implementation, \f[C]Markdown.pl\f[], does not follow it. +So pandoc will give different results than \f[C]Markdown.pl\f[] when +authors have indented continuation paragraphs fewer than four spaces. +.PP +The markdown syntax guide is not explicit whether the four-space rule +applies to \f[I]all\f[] block-level content in a list item; it only +mentions paragraphs and code blocks. +But it implies that the rule applies to all block-level content +(including nested lists), and pandoc interprets it that way. .SS Ordered lists .PP Ordered lists work just like bulleted lists, except that the items begin diff --git a/pandoc.cabal b/pandoc.cabal index 9d75c6062..f2e403c63 100644 --- a/pandoc.cabal +++ b/pandoc.cabal @@ -1,17 +1,17 @@ Name: pandoc -Version: 1.8.0.1 +Version: 1.8.0.3 Cabal-Version: >= 1.6 Build-Type: Custom License: GPL License-File: COPYING -Copyright: (c) 2006-2010 John MacFarlane +Copyright: (c) 2006-2011 John MacFarlane Author: John MacFarlane <jgm@berkeley.edu> Maintainer: John MacFarlane <jgm@berkeley.edu> Bug-Reports: http://code.google.com/p/pandoc/issues/list Stability: alpha Homepage: http://johnmacfarlane.net/pandoc Category: Text -Tested-With: GHC == 6.12.1, GHC == 6.12.3, GHC == 7.0.1 +Tested-With: GHC == 6.10.4, GHC == 6.12.1, GHC == 6.12.3, GHC == 7.0.1 Synopsis: Conversion between markup formats Description: Pandoc is a Haskell library for converting from one markup format to another, and a command-line tool that uses @@ -160,6 +160,10 @@ Extra-Tmp-Files: man/man1/pandoc.1, man/man1/markdown2pdf.1, man/man5/pandoc_markdown.5 +Source-repository head + type: git + location: git://github.com/jgm/pandoc.git + Flag threaded Description: Compile markdown2pdf with -threaded option. Default: True diff --git a/src/Tests/Arbitrary.hs b/src/Tests/Arbitrary.hs index 978717bef..39491431d 100644 --- a/src/Tests/Arbitrary.hs +++ b/src/Tests/Arbitrary.hs @@ -6,17 +6,20 @@ where import Test.QuickCheck.Gen import Test.QuickCheck.Arbitrary import Control.Monad (liftM, liftM2) -import Text.Pandoc -import Text.Pandoc.Shared +import Text.Pandoc.Definition +import Text.Pandoc.Shared (normalize, escapeURI) import Text.Pandoc.Builder realString :: Gen String -realString = resize 8 arbitrary -- elements wordlist +realString = resize 8 $ listOf $ frequency [ (9, elements [' '..'\127']) + , (1, elements ['\128'..'\9999']) ] -{- -wordlist :: [String] -wordlist = ["foo","Bar","baz","\\","/",":","\"","'","féé"] --} +arbAttr :: Gen Attr +arbAttr = do + id' <- elements ["","loc"] + classes <- elements [[],["haskell"],["c","numberLines"]] + keyvals <- elements [[],[("start","22")],[("a","11"),("b_2","a b c")]] + return (id',classes,keyvals) instance Arbitrary Inlines where arbitrary = liftM fromList arbitrary @@ -27,69 +30,79 @@ instance Arbitrary Blocks where instance Arbitrary Inline where arbitrary = resize 3 $ arbInline 3 +arbInlines :: Int -> Gen [Inline] +arbInlines n = listOf1 (arbInline n) `suchThat` (not . startsWithSpace) + where startsWithSpace (Space:_) = True + startsWithSpace _ = False + -- restrict to 3 levels of nesting max; otherwise we get -- bogged down in indefinitely large structures arbInline :: Int -> Gen Inline arbInline n = frequency $ [ (60, liftM Str realString) , (60, return Space) - , (10, liftM2 Code arbitrary realString) + , (10, liftM2 Code arbAttr realString) , (5, return EmDash) , (5, return EnDash) , (5, return Apostrophe) , (5, return Ellipses) - , (5, elements [ RawInline "html" "<a>*&*</a>" + , (5, elements [ RawInline "html" "<a id=\"eek\">" , RawInline "latex" "\\my{command}" ]) ] ++ [ x | x <- nesters, n > 1] - where nesters = [ (10, liftM Emph $ listOf $ arbInline (n-1)) - , (10, liftM Strong $ listOf $ arbInline (n-1)) - , (10, liftM Strikeout $ listOf $ arbInline (n-1)) - , (10, liftM Superscript $ listOf $ arbInline (n-1)) - , (10, liftM Subscript $ listOf $ arbInline (n-1)) - , (10, liftM SmallCaps $ listOf $ arbInline (n-1)) + where nesters = [ (10, liftM Emph $ arbInlines (n-1)) + , (10, liftM Strong $ arbInlines (n-1)) + , (10, liftM Strikeout $ arbInlines (n-1)) + , (10, liftM Superscript $ arbInlines (n-1)) + , (10, liftM Subscript $ arbInlines (n-1)) +-- , (10, liftM SmallCaps $ arbInlines (n-1)) , (10, do x1 <- arbitrary - x2 <- listOf $ arbInline (n-1) + x2 <- arbInlines (n-1) return $ Quoted x1 x2) , (10, do x1 <- arbitrary x2 <- realString return $ Math x1 x2) - , (10, do x1 <- listOf $ arbInline (n-1) + , (10, do x1 <- arbInlines (n-1) x3 <- realString - x2 <- realString + x2 <- liftM escapeURI realString return $ Link x1 (x2,x3)) - , (10, do x1 <- listOf $ arbInline (n-1) + , (10, do x1 <- arbInlines (n-1) x3 <- realString - x2 <- realString + x2 <- liftM escapeURI realString return $ Image x1 (x2,x3)) - , (2, liftM Note $ resize 3 $ listOf1 arbitrary) + , (2, liftM Note $ resize 3 $ listOf1 $ arbBlock (n-1)) ] instance Arbitrary Block where arbitrary = resize 3 $ arbBlock 3 arbBlock :: Int -> Gen Block -arbBlock n = frequency $ [ (10, liftM Plain arbitrary) - , (15, liftM Para arbitrary) - , (5, liftM2 CodeBlock arbitrary realString) +arbBlock n = frequency $ [ (10, liftM Plain $ arbInlines (n-1)) + , (15, liftM Para $ arbInlines (n-1)) + , (5, liftM2 CodeBlock arbAttr realString) , (2, elements [ RawBlock "html" "<div>\n*&*\n</div>" , RawBlock "latex" "\\begin[opt]{env}\nhi\n{\\end{env}" ]) , (5, do x1 <- choose (1 :: Int, 6) - x2 <- arbitrary + x2 <- arbInlines (n-1) return (Header x1 x2)) , (2, return HorizontalRule) ] ++ [x | x <- nesters, n > 0] - where nesters = [ (5, liftM BlockQuote $ listOf $ arbBlock (n-1)) - , (5, liftM2 OrderedList arbitrary - $ (listOf1 $ listOf1 $ arbBlock (n-1))) + where nesters = [ (5, liftM BlockQuote $ listOf1 $ arbBlock (n-1)) + , (5, do x2 <- arbitrary + x3 <- arbitrary + x1 <- arbitrary `suchThat` (> 0) + x4 <- listOf1 $ listOf1 $ arbBlock (n-1) + return $ OrderedList (x1,x2,x3) x4 ) , (5, liftM BulletList $ (listOf1 $ listOf1 $ arbBlock (n-1))) - , (5, do x1 <- listOf $ listOf1 $ listOf1 $ arbBlock (n-1) - x2 <- arbitrary - return (DefinitionList $ zip x2 x1)) + , (5, do items <- listOf1 $ do + x1 <- listOf1 $ listOf1 $ arbBlock (n-1) + x2 <- arbInlines (n-1) + return (x2,x1) + return $ DefinitionList items) , (2, do rs <- choose (1 :: Int, 4) cs <- choose (1 :: Int, 4) - x1 <- arbitrary + x1 <- arbInlines (n-1) x2 <- vector cs x3 <- vectorOf cs $ elements [0, 0.25] x4 <- vectorOf cs $ listOf $ arbBlock (n-1) diff --git a/src/Tests/Readers/Markdown.hs b/src/Tests/Readers/Markdown.hs index 722a45bdb..feec8fa65 100644 --- a/src/Tests/Readers/Markdown.hs +++ b/src/Tests/Readers/Markdown.hs @@ -6,6 +6,7 @@ import Test.Framework import Tests.Helpers import Tests.Arbitrary() import Text.Pandoc.Builder +-- import Text.Pandoc.Shared ( normalize ) import Text.Pandoc markdown :: String -> Pandoc @@ -16,6 +17,19 @@ infix 5 =: => String -> (String, c) -> Test (=:) = test markdown +{- +p_markdown_round_trip :: Block -> Bool +p_markdown_round_trip b = matches d' d'' + where d' = normalize $ Pandoc (Meta [] [] []) [b] + d'' = normalize + $ readMarkdown defaultParserState{ stateSmart = True } + $ writeMarkdown defaultWriterOptions d' + matches (Pandoc _ [Plain []]) (Pandoc _ []) = True + matches (Pandoc _ [Para []]) (Pandoc _ []) = True + matches (Pandoc _ [Plain xs]) (Pandoc _ [Para xs']) = xs == xs' + matches x y = x == y +-} + tests :: [Test] tests = [ testGroup "inline code" [ "with attribute" =: @@ -26,4 +40,16 @@ tests = [ testGroup "inline code" "`*` {.haskell .special x=\"7\"}" =?> para (codeWith ("",["haskell","special"],[("x","7")]) "*") ] + , testGroup "footnotes" + [ "indent followed by newline and flush-left text" =: + "[^1]\n\n[^1]: my note\n\n \nnot in note\n" + =?> para (note (para "my note")) +++ para "not in note" + , "indent followed by newline and indented text" =: + "[^1]\n\n[^1]: my note\n \n in note\n" + =?> para (note (para "my note" +++ para "in note")) + ] +-- the round-trip properties frequently fail +-- , testGroup "round trip" +-- [ property "p_markdown_round_trip" p_markdown_round_trip +-- ] ] diff --git a/src/Tests/Shared.hs b/src/Tests/Shared.hs index c35a158c1..f4bf13da4 100644 --- a/src/Tests/Shared.hs +++ b/src/Tests/Shared.hs @@ -10,6 +10,8 @@ tests :: [Test] tests = [ testGroup "normalize" [ property "p_normalize_blocks_rt" p_normalize_blocks_rt , property "p_normalize_inlines_rt" p_normalize_inlines_rt + , property "p_normalize_no_trailing_spaces" + p_normalize_no_trailing_spaces ] ] @@ -19,3 +21,6 @@ p_normalize_blocks_rt bs = normalize bs == normalize (normalize bs) p_normalize_inlines_rt :: [Inline] -> Bool p_normalize_inlines_rt ils = normalize ils == normalize (normalize ils) +p_normalize_no_trailing_spaces :: [Inline] -> Bool +p_normalize_no_trailing_spaces ils = null ils' || last ils' /= Space + where ils' = normalize $ ils ++ [Space] diff --git a/src/Tests/Writers/HTML.hs b/src/Tests/Writers/HTML.hs index e13d0dc87..3e1e0ddc2 100644 --- a/src/Tests/Writers/HTML.hs +++ b/src/Tests/Writers/HTML.hs @@ -38,4 +38,9 @@ tests = [ testGroup "inline code" , "nolanguage" =: codeWith ("",["nolanguage"],[]) ">>=" =?> "<code class=\"nolanguage\">>>=</code>" ] + , testGroup "images" + [ "alt with formatting" =: + image "/url" "title" ("my " +++ emph "image") + =?> "<img src=\"/url\" title=\"title\" alt=\"my image\" />" + ] ] diff --git a/src/Tests/Writers/Native.hs b/src/Tests/Writers/Native.hs index 234fe938a..19740e0f4 100644 --- a/src/Tests/Writers/Native.hs +++ b/src/Tests/Writers/Native.hs @@ -11,8 +11,9 @@ p_write_rt d = read (writeNative defaultWriterOptions{ writerStandalone = True } d) == d p_write_blocks_rt :: [Block] -> Bool -p_write_blocks_rt bs = - read (writeNative defaultWriterOptions (Pandoc (Meta [] [] []) bs)) == bs +p_write_blocks_rt bs = length bs > 20 || + read (writeNative defaultWriterOptions (Pandoc (Meta [] [] []) bs)) == + bs tests :: [Test] tests = [ property "p_write_rt" p_write_rt diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs index 58d2158bf..01cc5e2e8 100644 --- a/src/Text/Pandoc/Readers/Markdown.hs +++ b/src/Text/Pandoc/Readers/Markdown.hs @@ -245,15 +245,17 @@ noteMarker :: GenParser Char ParserState [Char] noteMarker = string "[^" >> many1Till (satisfy $ not . isBlank) (char ']') rawLine :: GenParser Char ParserState [Char] -rawLine = do +rawLine = try $ do notFollowedBy blankline notFollowedBy' $ try $ skipNonindentSpaces >> noteMarker - contents <- many1 nonEndline - end <- option "" (newline >> optional indentSpaces >> return "\n") - return $ contents ++ end + optional indentSpaces + anyLine rawLines :: GenParser Char ParserState [Char] -rawLines = many1 rawLine >>= return . concat +rawLines = do + first <- anyLine + rest <- many rawLine + return $ unlines (first:rest) noteBlock :: GenParser Char ParserState [Char] noteBlock = try $ do @@ -263,7 +265,9 @@ noteBlock = try $ do char ':' optional blankline optional indentSpaces - raw <- sepBy rawLines (try (blankline >> indentSpaces)) + raw <- sepBy rawLines + (try (blankline >> indentSpaces >> + notFollowedBy blankline)) optional blanklines endPos <- getPosition let newnote = (ref, (intercalate "\n" raw) ++ "\n\n") diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs index b1d5de63f..8326c89ae 100644 --- a/src/Text/Pandoc/Shared.hs +++ b/src/Text/Pandoc/Shared.hs @@ -243,10 +243,7 @@ orderedListMarkers (start, numstyle, numdelim) = -- remove empty Str elements. normalizeSpaces :: [Inline] -> [Inline] normalizeSpaces = cleanup . dropWhile isSpaceOrEmpty - where isSpaceOrEmpty Space = True - isSpaceOrEmpty (Str "") = True - isSpaceOrEmpty _ = False - cleanup [] = [] + where cleanup [] = [] cleanup (Space:rest) = let rest' = dropWhile isSpaceOrEmpty rest in case rest' of [] -> [] @@ -254,13 +251,18 @@ normalizeSpaces = cleanup . dropWhile isSpaceOrEmpty cleanup ((Str ""):rest) = cleanup rest cleanup (x:rest) = x : cleanup rest +isSpaceOrEmpty :: Inline -> Bool +isSpaceOrEmpty Space = True +isSpaceOrEmpty (Str "") = True +isSpaceOrEmpty _ = False + -- | Normalize @Pandoc@ document, consolidating doubled 'Space's, -- combining adjacent 'Str's and 'Emph's, remove 'Null's and -- empty elements, etc. normalize :: (Eq a, Data a) => a -> a normalize = topDown removeEmptyBlocks . topDown consolidateInlines . - bottomUp removeEmptyInlines + bottomUp (removeEmptyInlines . removeTrailingInlineSpaces) removeEmptyBlocks :: [Block] -> [Block] removeEmptyBlocks (Null : xs) = removeEmptyBlocks xs @@ -284,6 +286,12 @@ removeEmptyInlines (Str "" : zs) = removeEmptyInlines zs removeEmptyInlines (x : xs) = x : removeEmptyInlines xs removeEmptyInlines [] = [] +removeTrailingInlineSpaces :: [Inline] -> [Inline] +removeTrailingInlineSpaces = reverse . removeLeadingInlineSpaces . reverse + +removeLeadingInlineSpaces :: [Inline] -> [Inline] +removeLeadingInlineSpaces = dropWhile isSpaceOrEmpty + consolidateInlines :: [Inline] -> [Inline] consolidateInlines (Str x : ys) = case concat (x : map fromStr strs) of diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index ef14b6809..aba73a417 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -42,7 +42,7 @@ import Data.Char ( ord, toLower ) import Data.List ( isPrefixOf, intersperse ) import Data.Maybe ( catMaybes ) import Control.Monad.State -import Text.XHtml.Transitional hiding ( stringToHtml ) +import Text.XHtml.Transitional hiding ( stringToHtml, unordList, ordList ) import Text.TeXMath import Text.XML.Light.Output @@ -58,16 +58,17 @@ defaultWriterState = WriterState {stNotes= [], stMath = False, stHighlighting = -- Helpers to render HTML with the appropriate function. -renderFragment :: (HTML html) => WriterOptions -> html -> String -renderFragment opts = if writerWrapText opts - then renderHtmlFragment - else showHtmlFragment - -- | Modified version of Text.XHtml's stringToHtml. -- Use unicode characters wherever possible. stringToHtml :: String -> Html stringToHtml = primHtml . escapeStringForXML +-- | Hard linebreak. +nl :: WriterOptions -> Html +nl opts = if writerWrapText opts + then primHtml "\n" + else noHtml + -- | Convert Pandoc document to Html string. writeHtmlString :: WriterOptions -> Pandoc -> String writeHtmlString opts d = @@ -75,7 +76,7 @@ writeHtmlString opts d = defaultWriterState in if writerStandalone opts then inTemplate opts tit auths date toc body' newvars - else renderFragment opts body' + else dropWhile (=='\n') $ showHtmlFragment body' -- | Convert Pandoc document to Html structure. writeHtml :: WriterOptions -> Pandoc -> Html @@ -119,13 +120,13 @@ pandocToHtml opts (Pandoc (Meta title' authors' date') blocks) = do cutUp xs ++ [endSlide] _ -> [startSlide] ++ cutUp blocks ++ [endSlide] - blocks' <- liftM toHtmlFromList $ + blocks' <- liftM (toHtmlFromList . intersperse (nl opts)) $ if writerSlideVariant opts `elem` [SlidySlides, S5Slides] then mapM (blockToHtml opts) slides else mapM (elementToHtml opts) sects st <- get let notes = reverse (stNotes st) - let thebody = blocks' +++ footnoteSection notes + let thebody = blocks' +++ footnoteSection opts notes let math = if stMath st then case writerHTMLMathMethod opts of LaTeXMathML (Just url) -> @@ -147,7 +148,7 @@ pandocToHtml opts (Pandoc (Meta title' authors' date') blocks) = do else noHtml let newvars = [("highlighting-css", defaultHighlightingCss) | stHighlighting st] ++ - [("math", renderHtmlFragment math) | stMath st] + [("math", showHtmlFragment math) | stMath st] return (tit, auths, date, toc, thebody, newvars) inTemplate :: TemplateTarget a @@ -166,13 +167,13 @@ inTemplate opts tit auths date toc body' newvars = date' = stripTags $ showHtmlFragment date variables = writerVariables opts ++ newvars context = variables ++ - [ ("body", renderHtmlFragment body') + [ ("body", dropWhile (=='\n') $ showHtmlFragment body') , ("pagetitle", topTitle') - , ("title", renderHtmlFragment tit) + , ("title", dropWhile (=='\n') $ showHtmlFragment tit) , ("date", date') ] ++ [ ("html5","true") | writerHtml5 opts ] ++ (case toc of - Just t -> [ ("toc", renderHtmlFragment t)] + Just t -> [ ("toc", showHtmlFragment t)] Nothing -> []) ++ [ ("author", a) | a <- authors ] in renderTemplate context $ writerTemplate opts @@ -181,6 +182,14 @@ inTemplate opts tit auths date toc body' newvars = prefixedId :: WriterOptions -> String -> HtmlAttr prefixedId opts s = identifier $ writerIdentifierPrefix opts ++ s +-- | Replacement for Text.XHtml's unordList. +unordList :: WriterOptions -> ([Html] -> Html) +unordList opts items = ulist << toListItems opts items + +-- | Replacement for Text.XHtml's ordList. +ordList :: WriterOptions -> ([Html] -> Html) +ordList opts items = olist << toListItems opts items + -- | Construct table of contents from list of elements. tableOfContents :: WriterOptions -> [Element] -> State WriterState (Maybe Html) tableOfContents _ [] = return Nothing @@ -192,10 +201,12 @@ tableOfContents opts sects = do then Nothing else Just $ if writerHtml5 opts - then tag "nav" ! [prefixedId opts' "TOC"] $ - unordList tocList - else thediv ! [prefixedId opts' "TOC"] $ - unordList tocList + then (tag "nav" ! [prefixedId opts' "TOC"] $ + nl opts +++ unordList opts tocList +++ nl opts) + +++ nl opts + else (thediv ! [prefixedId opts' "TOC"] $ + nl opts +++ unordList opts tocList +++ nl opts) + +++ nl opts -- | Convert section number to string showSecNum :: [Int] -> String @@ -214,7 +225,7 @@ elementToListItem opts (Sec _ num id' headerText subsecs) = do subHeads <- mapM (elementToListItem opts) subsecs >>= return . catMaybes let subList = if null subHeads then noHtml - else unordList subHeads + else unordList opts subHeads return $ Just $ (anchor ! [href ("#" ++ writerIdentifierPrefix opts ++ id')] $ txt) +++ subList -- | Convert an Element to Html. @@ -230,21 +241,24 @@ elementToHtml opts (Sec level num id' title' elements) = do writerSectionDivs opts || slides)] let stuff = header'' : innerContents return $ if slides -- S5 gets confused by the extra divs around sections - then toHtmlFromList stuff + then toHtmlFromList $ intersperse (nl opts) stuff else if writerSectionDivs opts then if writerHtml5 opts then tag "section" ! [prefixedId opts id'] - << stuff - else thediv ! [prefixedId opts id'] << stuff - else toHtmlFromList stuff + << intersperse (nl opts) stuff + else thediv ! [prefixedId opts id'] << + intersperse (nl opts) stuff + else toHtmlFromList $ intersperse (nl opts) stuff -- | Convert list of Note blocks to a footnote <div>. -- Assumes notes are sorted. -footnoteSection :: [Html] -> Html -footnoteSection notes = +footnoteSection :: WriterOptions -> [Html] -> Html +footnoteSection opts notes = if null notes then noHtml - else thediv ! [theclass "footnotes"] $ hr +++ (olist << notes) + else nl opts +++ (thediv ! [theclass "footnotes"] + $ nl opts +++ hr +++ nl opts +++ + (olist << (notes ++ [nl opts])) +++ nl opts) -- | Parse a mailto link; return Just (name, domain) or Nothing. @@ -306,20 +320,23 @@ attrsToHtml opts (id',classes',keyvals) = -- | Convert Pandoc block element to HTML. blockToHtml :: WriterOptions -> Block -> State WriterState Html -blockToHtml _ Null = return $ noHtml +blockToHtml _ Null = return noHtml blockToHtml opts (Plain lst) = inlineListToHtml opts lst blockToHtml opts (Para [Image txt (s,tit)]) = do img <- inlineToHtml opts (Image txt (s,tit)) capt <- inlineListToHtml opts txt return $ if writerHtml5 opts then tag "figure" << - [img, tag "figcaption" << capt] + [nl opts, img, tag "figcaption" << capt, nl opts] else thediv ! [theclass "figure"] << - [img, paragraph ! [theclass "caption"] << capt] -blockToHtml opts (Para lst) = inlineListToHtml opts lst >>= (return . paragraph) + [nl opts, img, paragraph ! [theclass "caption"] << capt, + nl opts] +blockToHtml opts (Para lst) = do + contents <- inlineListToHtml opts lst + return $ paragraph contents blockToHtml _ (RawBlock "html" str) = return $ primHtml str blockToHtml _ (RawBlock _ _) = return noHtml -blockToHtml _ (HorizontalRule) = return $ hr +blockToHtml _ (HorizontalRule) = return hr blockToHtml opts (CodeBlock (id',classes,keyvals) rawCode) = do let classes' = if writerLiterateHaskell opts then classes @@ -335,7 +352,8 @@ blockToHtml opts (CodeBlock (id',classes,keyvals) rawCode) = do in return $ pre ! attrs $ thecode << (replicate (length leadingBreaks) br +++ [stringToHtml $ addBird rawCode']) - Right h -> modify (\st -> st{ stHighlighting = True }) >> return h + Right h -> modify (\st -> st{ stHighlighting = True }) >> + return h blockToHtml opts (BlockQuote blocks) = -- in S5, treat list in blockquote specially -- if default is incremental, make it nonincremental; @@ -348,9 +366,12 @@ blockToHtml opts (BlockQuote blocks) = [OrderedList attribs lst] -> blockToHtml (opts {writerIncremental = inc}) (OrderedList attribs lst) - _ -> blockListToHtml opts blocks >>= - (return . blockquote) - else blockListToHtml opts blocks >>= (return . blockquote) + _ -> do contents <- blockListToHtml opts blocks + return $ blockquote (nl opts +++ + contents +++ nl opts) + else do + contents <- blockListToHtml opts blocks + return $ blockquote (nl opts +++ contents +++ nl opts) blockToHtml opts (Header level lst) = do contents <- inlineListToHtml opts lst secnum <- liftM stSecNum get @@ -361,20 +382,20 @@ blockToHtml opts (Header level lst) = do let contents'' = if writerTableOfContents opts then anchor ! [href $ "#" ++ writerIdentifierPrefix opts ++ "TOC"] $ contents' else contents' - return $ case level of + return $ (case level of 1 -> h1 contents'' 2 -> h2 contents'' 3 -> h3 contents'' 4 -> h4 contents'' 5 -> h5 contents'' 6 -> h6 contents'' - _ -> paragraph contents'' + _ -> paragraph contents'') blockToHtml opts (BulletList lst) = do contents <- mapM (blockListToHtml opts) lst let attribs = if writerIncremental opts then [theclass "incremental"] else [] - return $ unordList ! attribs $ contents + return $ (unordList opts contents) ! attribs blockToHtml opts (OrderedList (startnum, numstyle, _) lst) = do contents <- mapM (blockListToHtml opts) lst let numstyle' = camelCaseToHyphenated $ show numstyle @@ -397,20 +418,23 @@ blockToHtml opts (OrderedList (startnum, numstyle, _) lst) = do else [thestyle $ "list-style-type: " ++ numstyle'] else []) - return $ ordList ! attribs $ contents + return $ (ordList opts contents) ! attribs blockToHtml opts (DefinitionList lst) = do contents <- mapM (\(term, defs) -> do term' <- liftM (dterm <<) $ inlineListToHtml opts term - defs' <- mapM (liftM (ddef <<) . blockListToHtml opts) defs - return $ term' : defs') lst + defs' <- mapM ((liftM (\x -> ddef << (x +++ nl opts))) . + blockListToHtml opts) defs + return $ nl opts : term' : nl opts : defs') lst let attribs = if writerIncremental opts then [theclass "incremental"] else [] - return $ dlist ! attribs << concat contents + return $ dlist ! attribs << (concat contents +++ nl opts) blockToHtml opts (Table capt aligns widths headers rows') = do captionDoc <- if null capt then return noHtml - else inlineListToHtml opts capt >>= return . caption + else do + cs <- inlineListToHtml opts capt + return $ caption cs +++ nl opts let percent w = show (truncate (100*w) :: Integer) ++ "%" let widthAttrs w = if writerHtml5 opts then [thestyle $ "width: " ++ percent w] @@ -418,13 +442,17 @@ blockToHtml opts (Table capt aligns widths headers rows') = do let coltags = if all (== 0.0) widths then noHtml else concatHtml $ map - (\w -> col ! (widthAttrs w) $ noHtml) widths + (\w -> (col ! (widthAttrs w)) noHtml +++ nl opts) + widths head' <- if all null headers then return noHtml - else liftM (thead <<) $ tableRowToHtml opts aligns 0 headers - body' <- liftM (tbody <<) $ + else do + contents <- tableRowToHtml opts aligns 0 headers + return $ thead << (nl opts +++ contents) +++ nl opts + body' <- liftM (\x -> tbody << (nl opts +++ x)) $ zipWithM (tableRowToHtml opts aligns) [1..] rows' - return $ table $ captionDoc +++ coltags +++ head' +++ body' + return $ table $ nl opts +++ captionDoc +++ coltags +++ head' +++ + body' +++ nl opts tableRowToHtml :: WriterOptions -> [Alignment] @@ -440,7 +468,8 @@ tableRowToHtml opts aligns rownum cols' = do cols'' <- sequence $ zipWith (\alignment item -> tableItemToHtml opts mkcell alignment item) aligns cols' - return $ tr ! [theclass rowclass] $ toHtmlFromList cols'' + return $ (tr ! [theclass rowclass] $ nl opts +++ toHtmlFromList cols'') + +++ nl opts alignmentToString :: Alignment -> [Char] alignmentToString alignment = case alignment of @@ -459,11 +488,18 @@ tableItemToHtml opts tag' align' item = do let alignAttrs = if writerHtml5 opts then [thestyle $ "align: " ++ alignmentToString align'] else [align $ alignmentToString align'] - return $ tag' ! alignAttrs $ contents + return $ (tag' ! alignAttrs) contents +++ nl opts + +toListItems :: WriterOptions -> [Html] -> [Html] +toListItems opts items = map (toListItem opts) items ++ [nl opts] + +toListItem :: WriterOptions -> Html -> Html +toListItem opts item = nl opts +++ li item blockListToHtml :: WriterOptions -> [Block] -> State WriterState Html -blockListToHtml opts lst = - mapM (blockToHtml opts) lst >>= return . toHtmlFromList +blockListToHtml opts lst = + mapM (blockToHtml opts) lst >>= + return . toHtmlFromList . intersperse (nl opts) -- | Convert list of Pandoc inline elements to HTML. inlineListToHtml :: WriterOptions -> [Inline] -> State WriterState Html @@ -566,8 +602,7 @@ inlineToHtml opts inline = if null tit then [] else [title tit]) $ linkText (Image txt (s,tit)) -> do - alternate <- inlineListToHtml opts txt - let alternate' = renderFragment opts alternate + let alternate' = stringify txt let attributes = [src s] ++ (if null tit then [] @@ -610,5 +645,5 @@ blockListToNote opts ref blocks = _ -> otherBlocks ++ [lastBlock, Plain backlink] in do contents <- blockListToHtml opts blocks' - return $ li ! [prefixedId opts ("fn" ++ ref)] $ contents + return $ nl opts +++ (li ! [prefixedId opts ("fn" ++ ref)]) contents diff --git a/src/markdown2pdf.hs b/src/markdown2pdf.hs index 4070001f1..c61aaa8cb 100644 --- a/src/markdown2pdf.hs +++ b/src/markdown2pdf.hs @@ -37,7 +37,7 @@ parsePandocArgs args = do runPandoc :: [String] -> FilePath -> IO (Either String FilePath) runPandoc inputsAndArgs output = do - let texFile = replaceExtension output "tex" + let texFile = addExtension output "tex" result <- run "pandoc" $ ["-s", "--no-wrap", "-r", "markdown", "-w", "latex"] ++ inputsAndArgs ++ ["-o", texFile] diff --git a/tests/lhs-test.fragment.html+lhs b/tests/lhs-test.fragment.html+lhs index 7757bc634..76ba4ef1a 100644 --- a/tests/lhs-test.fragment.html+lhs +++ b/tests/lhs-test.fragment.html+lhs @@ -1,50 +1,15 @@ -<h1 id="lhs-test" ->lhs test</h1 -><p -><code - >unsplit</code - > is an arrow that takes a pair of values and combines them to return a single value:</p -><pre class="sourceCode haskell" -><code - >> <span class="ot" - >unsplit </span - ><span class="ot" - >::</span - > (<span class="dt" - >Arrow</span - > a) <span class="ot" - >=></span - > (b <span class="ot" - >-></span - > c <span class="ot" - >-></span - > d) <span class="ot" - >-></span - > a (b, c) d<br - />> unsplit <span class="fu" - >=</span - > arr <span class="fu" - >.</span - > <span class="fu" - >uncurry</span - > <br - />> <span class="co" - >-- arr (\op (x,y) -> x `op` y) </span - ></code - ></pre -><p -><code - >(***)</code - > combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the second item of the pair).</p -><pre -><code - >f *** g = first f >>> second g -</code - ></pre -><p ->Block quote:</p -><blockquote -><p - >foo bar</p - ></blockquote -> +<h1 id="lhs-test">lhs test</h1> + +<p><code>unsplit</code> is an arrow that takes a pair of values and combines them to return a single value:</p> + +<pre class="sourceCode haskell"><code>> <span class="ot">unsplit </span><span class="ot">::</span> (<span class="dt">Arrow</span> a) <span class="ot">=></span> (b <span class="ot">-></span> c <span class="ot">-></span> d) <span class="ot">-></span> a (b, c) d<br/>> unsplit <span class="fu">=</span> arr <span class="fu">.</span> <span class="fu">uncurry</span> <br/>> <span class="co">-- arr (\op (x,y) -> x `op` y) </span></code></pre> + +<p><code>(***)</code> combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the second item of the pair).</p> + +<pre><code>f *** g = first f >>> second g</code></pre> + +<p>Block quote:</p> + +<blockquote> +<p>foo bar</p> +</blockquote> diff --git a/tests/lhs-test.html b/tests/lhs-test.html index 0e5587a83..d1ea1f128 100644 --- a/tests/lhs-test.html +++ b/tests/lhs-test.html @@ -25,55 +25,15 @@ code.sourceCode span.er { color: red; font-weight: bold; } </style> </head> <body> -<h1 id="lhs-test" ->lhs test</h1 -><p -><code - >unsplit</code - > is an arrow that takes a pair of values and combines them to return a single value:</p -><pre class="sourceCode" -><code class="sourceCode haskell" - ><span class="ot" - >unsplit </span - ><span class="ot" - >::</span - > (<span class="dt" - >Arrow</span - > a) <span class="ot" - >=></span - > (b <span class="ot" - >-></span - > c <span class="ot" - >-></span - > d) <span class="ot" - >-></span - > a (b, c) d<br - />unsplit <span class="fu" - >=</span - > arr <span class="fu" - >.</span - > <span class="fu" - >uncurry</span - > <br - /> <span class="co" - >-- arr (\op (x,y) -> x `op` y) </span - ></code - ></pre -><p -><code - >(***)</code - > combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the second item of the pair).</p -><pre -><code - >f *** g = first f >>> second g -</code - ></pre -><p ->Block quote:</p -><blockquote -><p - >foo bar</p - ></blockquote -> +<h1 id="lhs-test">lhs test</h1> +<p><code>unsplit</code> is an arrow that takes a pair of values and combines them to return a single value:</p> +<pre class="sourceCode"><code class="sourceCode haskell"><span class="ot">unsplit </span><span class="ot">::</span> (<span class="dt">Arrow</span> a) <span class="ot">=></span> (b <span class="ot">-></span> c <span class="ot">-></span> d) <span class="ot">-></span> a (b, c) d<br />unsplit <span class="fu">=</span> arr <span class="fu">.</span> <span class="fu">uncurry</span> <br /> <span class="co">-- arr (\op (x,y) -> x `op` y) </span></code></pre> +<p><code>(***)</code> combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the second item of the pair).</p> +<pre><code>f *** g = first f >>> second g +</code></pre> +<p>Block quote:</p> +<blockquote> +<p>foo bar</p> +</blockquote> </body> </html> diff --git a/tests/lhs-test.html+lhs b/tests/lhs-test.html+lhs index 8a4b82e0a..269974eb4 100644 --- a/tests/lhs-test.html+lhs +++ b/tests/lhs-test.html+lhs @@ -25,55 +25,15 @@ code.sourceCode span.er { color: red; font-weight: bold; } </style> </head> <body> -<h1 id="lhs-test" ->lhs test</h1 -><p -><code - >unsplit</code - > is an arrow that takes a pair of values and combines them to return a single value:</p -><pre class="sourceCode" -><code class="sourceCode haskell" - >> <span class="ot" - >unsplit </span - ><span class="ot" - >::</span - > (<span class="dt" - >Arrow</span - > a) <span class="ot" - >=></span - > (b <span class="ot" - >-></span - > c <span class="ot" - >-></span - > d) <span class="ot" - >-></span - > a (b, c) d<br - />> unsplit <span class="fu" - >=</span - > arr <span class="fu" - >.</span - > <span class="fu" - >uncurry</span - > <br - />> <span class="co" - >-- arr (\op (x,y) -> x `op` y) </span - ></code - ></pre -><p -><code - >(***)</code - > combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the second item of the pair).</p -><pre -><code - >f *** g = first f >>> second g -</code - ></pre -><p ->Block quote:</p -><blockquote -><p - >foo bar</p - ></blockquote -> +<h1 id="lhs-test">lhs test</h1> +<p><code>unsplit</code> is an arrow that takes a pair of values and combines them to return a single value:</p> +<pre class="sourceCode"><code class="sourceCode haskell">> <span class="ot">unsplit </span><span class="ot">::</span> (<span class="dt">Arrow</span> a) <span class="ot">=></span> (b <span class="ot">-></span> c <span class="ot">-></span> d) <span class="ot">-></span> a (b, c) d<br />> unsplit <span class="fu">=</span> arr <span class="fu">.</span> <span class="fu">uncurry</span> <br />> <span class="co">-- arr (\op (x,y) -> x `op` y) </span></code></pre> +<p><code>(***)</code> combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the second item of the pair).</p> +<pre><code>f *** g = first f >>> second g +</code></pre> +<p>Block quote:</p> +<blockquote> +<p>foo bar</p> +</blockquote> </body> </html> diff --git a/tests/lhs-test.nohl.html b/tests/lhs-test.nohl.html index cb03679f3..d1ea1f128 100644 --- a/tests/lhs-test.nohl.html +++ b/tests/lhs-test.nohl.html @@ -4,36 +4,36 @@ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="generator" content="pandoc" /> <title></title> + <style type="text/css"> +table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode, table.sourceCode pre + { margin: 0; padding: 0; border: 0; vertical-align: baseline; border: none; } +td.lineNumbers { border-right: 1px solid #AAAAAA; text-align: right; color: #AAAAAA; padding-right: 5px; padding-left: 5px; } +td.sourceCode { padding-left: 5px; } +code.sourceCode span.kw { color: #007020; font-weight: bold; } +code.sourceCode span.dt { color: #902000; } +code.sourceCode span.dv { color: #40a070; } +code.sourceCode span.bn { color: #40a070; } +code.sourceCode span.fl { color: #40a070; } +code.sourceCode span.ch { color: #4070a0; } +code.sourceCode span.st { color: #4070a0; } +code.sourceCode span.co { color: #60a0b0; font-style: italic; } +code.sourceCode span.ot { color: #007020; } +code.sourceCode span.al { color: red; font-weight: bold; } +code.sourceCode span.fu { color: #06287e; } +code.sourceCode span.re { } +code.sourceCode span.er { color: red; font-weight: bold; } + </style> </head> <body> -<h1 id="lhs-test" ->lhs test</h1 -><p -><code - >unsplit</code - > is an arrow that takes a pair of values and combines them to return a single value:</p -><pre class="sourceCode haskell" -><code - >unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d -unsplit = arr . uncurry - -- arr (\op (x,y) -> x `op` y) -</code - ></pre -><p -><code - >(***)</code - > combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the second item of the pair).</p -><pre -><code - >f *** g = first f >>> second g -</code - ></pre -><p ->Block quote:</p -><blockquote -><p - >foo bar</p - ></blockquote -> +<h1 id="lhs-test">lhs test</h1> +<p><code>unsplit</code> is an arrow that takes a pair of values and combines them to return a single value:</p> +<pre class="sourceCode"><code class="sourceCode haskell"><span class="ot">unsplit </span><span class="ot">::</span> (<span class="dt">Arrow</span> a) <span class="ot">=></span> (b <span class="ot">-></span> c <span class="ot">-></span> d) <span class="ot">-></span> a (b, c) d<br />unsplit <span class="fu">=</span> arr <span class="fu">.</span> <span class="fu">uncurry</span> <br /> <span class="co">-- arr (\op (x,y) -> x `op` y) </span></code></pre> +<p><code>(***)</code> combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the second item of the pair).</p> +<pre><code>f *** g = first f >>> second g +</code></pre> +<p>Block quote:</p> +<blockquote> +<p>foo bar</p> +</blockquote> </body> </html> diff --git a/tests/lhs-test.nohl.html+lhs b/tests/lhs-test.nohl.html+lhs index 8b972a044..269974eb4 100644 --- a/tests/lhs-test.nohl.html+lhs +++ b/tests/lhs-test.nohl.html+lhs @@ -4,36 +4,36 @@ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="generator" content="pandoc" /> <title></title> + <style type="text/css"> +table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode, table.sourceCode pre + { margin: 0; padding: 0; border: 0; vertical-align: baseline; border: none; } +td.lineNumbers { border-right: 1px solid #AAAAAA; text-align: right; color: #AAAAAA; padding-right: 5px; padding-left: 5px; } +td.sourceCode { padding-left: 5px; } +code.sourceCode span.kw { color: #007020; font-weight: bold; } +code.sourceCode span.dt { color: #902000; } +code.sourceCode span.dv { color: #40a070; } +code.sourceCode span.bn { color: #40a070; } +code.sourceCode span.fl { color: #40a070; } +code.sourceCode span.ch { color: #4070a0; } +code.sourceCode span.st { color: #4070a0; } +code.sourceCode span.co { color: #60a0b0; font-style: italic; } +code.sourceCode span.ot { color: #007020; } +code.sourceCode span.al { color: red; font-weight: bold; } +code.sourceCode span.fu { color: #06287e; } +code.sourceCode span.re { } +code.sourceCode span.er { color: red; font-weight: bold; } + </style> </head> <body> -<h1 id="lhs-test" ->lhs test</h1 -><p -><code - >unsplit</code - > is an arrow that takes a pair of values and combines them to return a single value:</p -><pre class="sourceCode literate haskell" -><code - >> unsplit :: (Arrow a) => (b -> c -> d) -> a (b, c) d -> unsplit = arr . uncurry -> -- arr (\op (x,y) -> x `op` y) -</code - ></pre -><p -><code - >(***)</code - > combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the second item of the pair).</p -><pre -><code - >f *** g = first f >>> second g -</code - ></pre -><p ->Block quote:</p -><blockquote -><p - >foo bar</p - ></blockquote -> +<h1 id="lhs-test">lhs test</h1> +<p><code>unsplit</code> is an arrow that takes a pair of values and combines them to return a single value:</p> +<pre class="sourceCode"><code class="sourceCode haskell">> <span class="ot">unsplit </span><span class="ot">::</span> (<span class="dt">Arrow</span> a) <span class="ot">=></span> (b <span class="ot">-></span> c <span class="ot">-></span> d) <span class="ot">-></span> a (b, c) d<br />> unsplit <span class="fu">=</span> arr <span class="fu">.</span> <span class="fu">uncurry</span> <br />> <span class="co">-- arr (\op (x,y) -> x `op` y) </span></code></pre> +<p><code>(***)</code> combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the second item of the pair).</p> +<pre><code>f *** g = first f >>> second g +</code></pre> +<p>Block quote:</p> +<blockquote> +<p>foo bar</p> +</blockquote> </body> </html> diff --git a/tests/s5.basic.html b/tests/s5.basic.html index 64971417a..34016bf18 100644 --- a/tests/s5.basic.html +++ b/tests/s5.basic.html @@ -35,25 +35,21 @@ <h4>July 15, 2006</h4> </div> <div class="slide"> -<h1 ->First slide</h1 -><ul -><li - >first bullet</li - ><li - >second bullet</li - ></ul -></div> + +<h1>First slide</h1> +<ul> +<li>first bullet</li> +<li>second bullet</li> +</ul> +</div> + <div class="slide"> -<h1 ->Math</h1 -><ul -><li - ><span class="math" - >$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</span - ></li - ></ul -></div> + +<h1>Math</h1> +<ul> +<li><span class="math">$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</span></li> +</ul> +</div> </div> </body> </html> diff --git a/tests/s5.fancy.html b/tests/s5.fancy.html index 200990b6a..6fc2d51f4 100644 --- a/tests/s5.fancy.html +++ b/tests/s5.fancy.html @@ -17,8 +17,7 @@ <link rel="stylesheet" href="ui/default/opera.css" type="text/css" media="projection" id="operaFix" /> <!-- S5 JS --> <script src="ui/default/slides.js" type="text/javascript"></script> - <script type="text/javascript" - >/* + <script type="text/javascript">/* LaTeXMathML.js from http://math.etsu.edu/LaTeXMathML/ Adapted by Jeff Knisely and Douglas Woodall from ASCIIMathML.js v. 1.4.7, (c) 2005 Peter Jipsen http://www.chapman.edu/~jipsen. @@ -216,8 +215,7 @@ {existing();generic();};} else {window.onload=generic;}} - </script - > + </script> </head> <body> <div class="layout"> @@ -236,25 +234,21 @@ <h4>July 15, 2006</h4> </div> <div class="slide"> -<h1 ->First slide</h1 -><ul class="incremental" -><li - >first bullet</li - ><li - >second bullet</li - ></ul -></div> + +<h1>First slide</h1> +<ul class="incremental"> +<li>first bullet</li> +<li>second bullet</li> +</ul> +</div> + <div class="slide"> -<h1 ->Math</h1 -><ul class="incremental" -><li - ><span class="LaTeX" - >$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</span - ></li - ></ul -></div> + +<h1>Math</h1> +<ul class="incremental"> +<li><span class="LaTeX">$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</span></li> +</ul> +</div> </div> </body> </html> diff --git a/tests/s5.fragment.html b/tests/s5.fragment.html index 9845e1409..e8a888972 100644 --- a/tests/s5.fragment.html +++ b/tests/s5.fragment.html @@ -1,17 +1,9 @@ -<h1 id="first-slide" ->First slide</h1 -><ul -><li - >first bullet</li - ><li - >second bullet</li - ></ul -><h1 id="math" ->Math</h1 -><ul -><li - ><span class="math" - >$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</span - ></li - ></ul -> +<h1 id="first-slide">First slide</h1> +<ul> +<li>first bullet</li> +<li>second bullet</li> +</ul> +<h1 id="math">Math</h1> +<ul> +<li><span class="math">$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</span></li> +</ul> diff --git a/tests/s5.inserts.html b/tests/s5.inserts.html index 3010ef758..534da25d3 100644 --- a/tests/s5.inserts.html +++ b/tests/s5.inserts.html @@ -13,23 +13,15 @@ <body> STUFF INSERTED <h1 class="title">My S5 Document</h1> -<h1 id="first-slide" ->First slide</h1 -><ul -><li - >first bullet</li - ><li - >second bullet</li - ></ul -><h1 id="math" ->Math</h1 -><ul -><li - ><span class="math" - >$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</span - ></li - ></ul -> +<h1 id="first-slide">First slide</h1> +<ul> +<li>first bullet</li> +<li>second bullet</li> +</ul> +<h1 id="math">Math</h1> +<ul> +<li><span class="math">$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</span></li> +</ul> STUFF INSERTED </body> </html> diff --git a/tests/tables.html b/tests/tables.html index e4dd6be58..b72aa784e 100644 --- a/tests/tables.html +++ b/tests/tables.html @@ -1,301 +1,198 @@ -<p ->Simple table with caption:</p -><table -><caption - >Demonstration of simple table syntax.</caption - ><thead - ><tr class="header" - ><th align="right" - >Right</th - ><th align="left" - >Left</th - ><th align="center" - >Center</th - ><th align="left" - >Default</th - ></tr - ></thead - ><tbody - ><tr class="odd" - ><td align="right" - >12</td - ><td align="left" - >12</td - ><td align="center" - >12</td - ><td align="left" - >12</td - ></tr - ><tr class="even" - ><td align="right" - >123</td - ><td align="left" - >123</td - ><td align="center" - >123</td - ><td align="left" - >123</td - ></tr - ><tr class="odd" - ><td align="right" - >1</td - ><td align="left" - >1</td - ><td align="center" - >1</td - ><td align="left" - >1</td - ></tr - ></tbody - ></table -><p ->Simple table without caption:</p -><table -><thead - ><tr class="header" - ><th align="right" - >Right</th - ><th align="left" - >Left</th - ><th align="center" - >Center</th - ><th align="left" - >Default</th - ></tr - ></thead - ><tbody - ><tr class="odd" - ><td align="right" - >12</td - ><td align="left" - >12</td - ><td align="center" - >12</td - ><td align="left" - >12</td - ></tr - ><tr class="even" - ><td align="right" - >123</td - ><td align="left" - >123</td - ><td align="center" - >123</td - ><td align="left" - >123</td - ></tr - ><tr class="odd" - ><td align="right" - >1</td - ><td align="left" - >1</td - ><td align="center" - >1</td - ><td align="left" - >1</td - ></tr - ></tbody - ></table -><p ->Simple table indented two spaces:</p -><table -><caption - >Demonstration of simple table syntax.</caption - ><thead - ><tr class="header" - ><th align="right" - >Right</th - ><th align="left" - >Left</th - ><th align="center" - >Center</th - ><th align="left" - >Default</th - ></tr - ></thead - ><tbody - ><tr class="odd" - ><td align="right" - >12</td - ><td align="left" - >12</td - ><td align="center" - >12</td - ><td align="left" - >12</td - ></tr - ><tr class="even" - ><td align="right" - >123</td - ><td align="left" - >123</td - ><td align="center" - >123</td - ><td align="left" - >123</td - ></tr - ><tr class="odd" - ><td align="right" - >1</td - ><td align="left" - >1</td - ><td align="center" - >1</td - ><td align="left" - >1</td - ></tr - ></tbody - ></table -><p ->Multiline table with caption:</p -><table -><caption - >Here's the caption. It may span multiple lines.</caption - ><col width="15%" - /><col width="13%" - /><col width="16%" - /><col width="33%" - /><thead - ><tr class="header" - ><th align="center" - >Centered Header</th - ><th align="left" - >Left Aligned</th - ><th align="right" - >Right Aligned</th - ><th align="left" - >Default aligned</th - ></tr - ></thead - ><tbody - ><tr class="odd" - ><td align="center" - >First</td - ><td align="left" - >row</td - ><td align="right" - >12.0</td - ><td align="left" - >Example of a row that spans multiple lines.</td - ></tr - ><tr class="even" - ><td align="center" - >Second</td - ><td align="left" - >row</td - ><td align="right" - >5.0</td - ><td align="left" - >Here's another one. Note the blank line between rows.</td - ></tr - ></tbody - ></table -><p ->Multiline table without caption:</p -><table -><col width="15%" - /><col width="13%" - /><col width="16%" - /><col width="33%" - /><thead - ><tr class="header" - ><th align="center" - >Centered Header</th - ><th align="left" - >Left Aligned</th - ><th align="right" - >Right Aligned</th - ><th align="left" - >Default aligned</th - ></tr - ></thead - ><tbody - ><tr class="odd" - ><td align="center" - >First</td - ><td align="left" - >row</td - ><td align="right" - >12.0</td - ><td align="left" - >Example of a row that spans multiple lines.</td - ></tr - ><tr class="even" - ><td align="center" - >Second</td - ><td align="left" - >row</td - ><td align="right" - >5.0</td - ><td align="left" - >Here's another one. Note the blank line between rows.</td - ></tr - ></tbody - ></table -><p ->Table without column headers:</p -><table -><tbody - ><tr class="odd" - ><td align="right" - >12</td - ><td align="left" - >12</td - ><td align="center" - >12</td - ><td align="right" - >12</td - ></tr - ><tr class="even" - ><td align="right" - >123</td - ><td align="left" - >123</td - ><td align="center" - >123</td - ><td align="right" - >123</td - ></tr - ><tr class="odd" - ><td align="right" - >1</td - ><td align="left" - >1</td - ><td align="center" - >1</td - ><td align="right" - >1</td - ></tr - ></tbody - ></table -><p ->Multiline table without column headers:</p -><table -><col width="15%" - /><col width="13%" - /><col width="16%" - /><col width="33%" - /><tbody - ><tr class="odd" - ><td align="center" - >First</td - ><td align="left" - >row</td - ><td align="right" - >12.0</td - ><td align="left" - >Example of a row that spans multiple lines.</td - ></tr - ><tr class="even" - ><td align="center" - >Second</td - ><td align="left" - >row</td - ><td align="right" - >5.0</td - ><td align="left" - >Here's another one. Note the blank line between rows.</td - ></tr - ></tbody - ></table -> +<p>Simple table with caption:</p> +<table> +<caption>Demonstration of simple table syntax.</caption> +<thead> +<tr class="header"> +<th align="right">Right</th> +<th align="left">Left</th> +<th align="center">Center</th> +<th align="left">Default</th> +</tr> +</thead> +<tbody> +<tr class="odd"> +<td align="right">12</td> +<td align="left">12</td> +<td align="center">12</td> +<td align="left">12</td> +</tr> +<tr class="even"> +<td align="right">123</td> +<td align="left">123</td> +<td align="center">123</td> +<td align="left">123</td> +</tr> +<tr class="odd"> +<td align="right">1</td> +<td align="left">1</td> +<td align="center">1</td> +<td align="left">1</td> +</tr> +</tbody> +</table> +<p>Simple table without caption:</p> +<table> +<thead> +<tr class="header"> +<th align="right">Right</th> +<th align="left">Left</th> +<th align="center">Center</th> +<th align="left">Default</th> +</tr> +</thead> +<tbody> +<tr class="odd"> +<td align="right">12</td> +<td align="left">12</td> +<td align="center">12</td> +<td align="left">12</td> +</tr> +<tr class="even"> +<td align="right">123</td> +<td align="left">123</td> +<td align="center">123</td> +<td align="left">123</td> +</tr> +<tr class="odd"> +<td align="right">1</td> +<td align="left">1</td> +<td align="center">1</td> +<td align="left">1</td> +</tr> +</tbody> +</table> +<p>Simple table indented two spaces:</p> +<table> +<caption>Demonstration of simple table syntax.</caption> +<thead> +<tr class="header"> +<th align="right">Right</th> +<th align="left">Left</th> +<th align="center">Center</th> +<th align="left">Default</th> +</tr> +</thead> +<tbody> +<tr class="odd"> +<td align="right">12</td> +<td align="left">12</td> +<td align="center">12</td> +<td align="left">12</td> +</tr> +<tr class="even"> +<td align="right">123</td> +<td align="left">123</td> +<td align="center">123</td> +<td align="left">123</td> +</tr> +<tr class="odd"> +<td align="right">1</td> +<td align="left">1</td> +<td align="center">1</td> +<td align="left">1</td> +</tr> +</tbody> +</table> +<p>Multiline table with caption:</p> +<table> +<caption>Here's the caption. It may span multiple lines.</caption> +<col width="15%" /> +<col width="13%" /> +<col width="16%" /> +<col width="33%" /> +<thead> +<tr class="header"> +<th align="center">Centered Header</th> +<th align="left">Left Aligned</th> +<th align="right">Right Aligned</th> +<th align="left">Default aligned</th> +</tr> +</thead> +<tbody> +<tr class="odd"> +<td align="center">First</td> +<td align="left">row</td> +<td align="right">12.0</td> +<td align="left">Example of a row that spans multiple lines.</td> +</tr> +<tr class="even"> +<td align="center">Second</td> +<td align="left">row</td> +<td align="right">5.0</td> +<td align="left">Here's another one. Note the blank line between rows.</td> +</tr> +</tbody> +</table> +<p>Multiline table without caption:</p> +<table> +<col width="15%" /> +<col width="13%" /> +<col width="16%" /> +<col width="33%" /> +<thead> +<tr class="header"> +<th align="center">Centered Header</th> +<th align="left">Left Aligned</th> +<th align="right">Right Aligned</th> +<th align="left">Default aligned</th> +</tr> +</thead> +<tbody> +<tr class="odd"> +<td align="center">First</td> +<td align="left">row</td> +<td align="right">12.0</td> +<td align="left">Example of a row that spans multiple lines.</td> +</tr> +<tr class="even"> +<td align="center">Second</td> +<td align="left">row</td> +<td align="right">5.0</td> +<td align="left">Here's another one. Note the blank line between rows.</td> +</tr> +</tbody> +</table> +<p>Table without column headers:</p> +<table> +<tbody> +<tr class="odd"> +<td align="right">12</td> +<td align="left">12</td> +<td align="center">12</td> +<td align="right">12</td> +</tr> +<tr class="even"> +<td align="right">123</td> +<td align="left">123</td> +<td align="center">123</td> +<td align="right">123</td> +</tr> +<tr class="odd"> +<td align="right">1</td> +<td align="left">1</td> +<td align="center">1</td> +<td align="right">1</td> +</tr> +</tbody> +</table> +<p>Multiline table without column headers:</p> +<table> +<col width="15%" /> +<col width="13%" /> +<col width="16%" /> +<col width="33%" /> +<tbody> +<tr class="odd"> +<td align="center">First</td> +<td align="left">row</td> +<td align="right">12.0</td> +<td align="left">Example of a row that spans multiple lines.</td> +</tr> +<tr class="even"> +<td align="center">Second</td> +<td align="left">row</td> +<td align="right">5.0</td> +<td align="left">Here's another one. Note the blank line between rows.</td> +</tr> +</tbody> +</table> diff --git a/tests/writer.html b/tests/writer.html index 60f5f4a45..371e8e17a 100644 --- a/tests/writer.html +++ b/tests/writer.html @@ -10,624 +10,368 @@ </head> <body> <h1 class="title">Pandoc Test Suite</h1> -<p ->This is a set of tests for pandoc. Most of them are adapted from John Gruber’s markdown test suite.</p -><hr - /><h1 id="headers" ->Headers</h1 -><h2 id="level-2-with-an-embedded-link" ->Level 2 with an <a href="/url" - >embedded link</a - ></h2 -><h3 id="level-3-with-emphasis" ->Level 3 with <em - >emphasis</em - ></h3 -><h4 id="level-4" ->Level 4</h4 -><h5 id="level-5" ->Level 5</h5 -><h1 id="level-1" ->Level 1</h1 -><h2 id="level-2-with-emphasis" ->Level 2 with <em - >emphasis</em - ></h2 -><h3 id="level-3" ->Level 3</h3 -><p ->with no blank line</p -><h2 id="level-2" ->Level 2</h2 -><p ->with no blank line</p -><hr - /><h1 id="paragraphs" ->Paragraphs</h1 -><p ->Here’s a regular paragraph.</p -><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 -><p ->Here’s one with a bullet. * criminey.</p -><p ->There should be a hard line break<br - />here.</p -><hr - /><h1 id="block-quotes" ->Block Quotes</h1 -><p ->E-mail style:</p -><blockquote -><p - >This is a block quote. It is pretty short.</p - ></blockquote -><blockquote -><p - >Code in a block quote:</p - ><pre - ><code - >sub status { +<p>This is a set of tests for pandoc. Most of them are adapted from John Gruber’s markdown test suite.</p> +<hr /> +<h1 id="headers">Headers</h1> +<h2 id="level-2-with-an-embedded-link">Level 2 with an <a href="/url">embedded link</a></h2> +<h3 id="level-3-with-emphasis">Level 3 with <em>emphasis</em></h3> +<h4 id="level-4">Level 4</h4> +<h5 id="level-5">Level 5</h5> +<h1 id="level-1">Level 1</h1> +<h2 id="level-2-with-emphasis">Level 2 with <em>emphasis</em></h2> +<h3 id="level-3">Level 3</h3> +<p>with no blank line</p> +<h2 id="level-2">Level 2</h2> +<p>with no blank line</p> +<hr /> +<h1 id="paragraphs">Paragraphs</h1> +<p>Here’s a regular paragraph.</p> +<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> +<p>Here’s one with a bullet. * criminey.</p> +<p>There should be a hard line break<br />here.</p> +<hr /> +<h1 id="block-quotes">Block Quotes</h1> +<p>E-mail style:</p> +<blockquote> +<p>This is a block quote. It is pretty short.</p> +</blockquote> +<blockquote> +<p>Code in a block quote:</p> +<pre><code>sub status { print "working"; } -</code - ></pre - ><p - >A list:</p - ><ol style="list-style-type: decimal" - ><li - >item one</li - ><li - >item two</li - ></ol - ><p - >Nested block quotes:</p - ><blockquote - ><p - >nested</p - ></blockquote - ><blockquote - ><p - >nested</p - ></blockquote - ></blockquote -><p ->This should not be a block quote: 2 > 1.</p -><p ->And a following paragraph.</p -><hr - /><h1 id="code-blocks" ->Code Blocks</h1 -><p ->Code:</p -><pre -><code - >---- (should be four hyphens) +</code></pre> +<p>A list:</p> +<ol style="list-style-type: decimal"> +<li>item one</li> +<li>item two</li> +</ol> +<p>Nested block quotes:</p> +<blockquote> +<p>nested</p> +</blockquote> +<blockquote> +<p>nested</p> +</blockquote> +</blockquote> +<p>This should not be a block quote: 2 > 1.</p> +<p>And a following paragraph.</p> +<hr /> +<h1 id="code-blocks">Code Blocks</h1> +<p>Code:</p> +<pre><code>---- (should be four hyphens) sub status { print "working"; } this code block is indented by one tab -</code - ></pre -><p ->And:</p -><pre -><code - > this code block is indented by two tabs +</code></pre> +<p>And:</p> +<pre><code> this code block is indented by two tabs These should not be escaped: \$ \\ \> \[ \{ -</code - ></pre -><hr - /><h1 id="lists" ->Lists</h1 -><h2 id="unordered" ->Unordered</h2 -><p ->Asterisks tight:</p -><ul -><li - >asterisk 1</li - ><li - >asterisk 2</li - ><li - >asterisk 3</li - ></ul -><p ->Asterisks loose:</p -><ul -><li - ><p - >asterisk 1</p - ></li - ><li - ><p - >asterisk 2</p - ></li - ><li - ><p - >asterisk 3</p - ></li - ></ul -><p ->Pluses tight:</p -><ul -><li - >Plus 1</li - ><li - >Plus 2</li - ><li - >Plus 3</li - ></ul -><p ->Pluses loose:</p -><ul -><li - ><p - >Plus 1</p - ></li - ><li - ><p - >Plus 2</p - ></li - ><li - ><p - >Plus 3</p - ></li - ></ul -><p ->Minuses tight:</p -><ul -><li - >Minus 1</li - ><li - >Minus 2</li - ><li - >Minus 3</li - ></ul -><p ->Minuses loose:</p -><ul -><li - ><p - >Minus 1</p - ></li - ><li - ><p - >Minus 2</p - ></li - ><li - ><p - >Minus 3</p - ></li - ></ul -><h2 id="ordered" ->Ordered</h2 -><p ->Tight:</p -><ol style="list-style-type: decimal" -><li - >First</li - ><li - >Second</li - ><li - >Third</li - ></ol -><p ->and:</p -><ol style="list-style-type: decimal" -><li - >One</li - ><li - >Two</li - ><li - >Three</li - ></ol -><p ->Loose using tabs:</p -><ol style="list-style-type: decimal" -><li - ><p - >First</p - ></li - ><li - ><p - >Second</p - ></li - ><li - ><p - >Third</p - ></li - ></ol -><p ->and using spaces:</p -><ol style="list-style-type: decimal" -><li - ><p - >One</p - ></li - ><li - ><p - >Two</p - ></li - ><li - ><p - >Three</p - ></li - ></ol -><p ->Multiple paragraphs:</p -><ol style="list-style-type: decimal" -><li - ><p - >Item 1, graf one.</p - ><p - >Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.</p - ></li - ><li - ><p - >Item 2.</p - ></li - ><li - ><p - >Item 3.</p - ></li - ></ol -><h2 id="nested" ->Nested</h2 -><ul -><li - >Tab<ul - ><li - >Tab<ul - ><li - >Tab</li - ></ul - ></li - ></ul - ></li - ></ul -><p ->Here’s another:</p -><ol style="list-style-type: decimal" -><li - >First</li - ><li - >Second:<ul - ><li - >Fee</li - ><li - >Fie</li - ><li - >Foe</li - ></ul - ></li - ><li - >Third</li - ></ol -><p ->Same thing but with paragraphs:</p -><ol style="list-style-type: decimal" -><li - ><p - >First</p - ></li - ><li - ><p - >Second:</p - ><ul - ><li - >Fee</li - ><li - >Fie</li - ><li - >Foe</li - ></ul - ></li - ><li - ><p - >Third</p - ></li - ></ol -><h2 id="tabs-and-spaces" ->Tabs and spaces</h2 -><ul -><li - ><p - >this is a list item indented with tabs</p - ></li - ><li - ><p - >this is a list item indented with spaces</p - ><ul - ><li - ><p - >this is an example list item indented with tabs</p - ></li - ><li - ><p - >this is an example list item indented with spaces</p - ></li - ></ul - ></li - ></ul -><h2 id="fancy-list-markers" ->Fancy list markers</h2 -><ol start="2" style="list-style-type: decimal" -><li - >begins with 2</li - ><li - ><p - >and now 3</p - ><p - >with a continuation</p - ><ol start="4" style="list-style-type: lower-roman" - ><li - >sublist with roman numerals, starting with 4</li - ><li - >more items<ol style="list-style-type: upper-alpha" - ><li - >a subsublist</li - ><li - >a subsublist</li - ></ol - ></li - ></ol - ></li - ></ol -><p ->Nesting:</p -><ol style="list-style-type: upper-alpha" -><li - >Upper Alpha<ol style="list-style-type: upper-roman" - ><li - >Upper Roman.<ol start="6" style="list-style-type: decimal" - ><li - >Decimal start with 6<ol start="3" style="list-style-type: lower-alpha" - ><li - >Lower alpha with paren</li - ></ol - ></li - ></ol - ></li - ></ol - ></li - ></ol -><p ->Autonumbering:</p -><ol -><li - >Autonumber.</li - ><li - >More.<ol - ><li - >Nested.</li - ></ol - ></li - ></ol -><p ->Should not be a list item:</p -><p ->M.A. 2007</p -><p ->B. Williams</p -><hr - /><h1 id="definition-lists" ->Definition Lists</h1 -><p ->Tight using spaces:</p -><dl -><dt - >apple</dt - ><dd - >red fruit</dd - ><dt - >orange</dt - ><dd - >orange fruit</dd - ><dt - >banana</dt - ><dd - >yellow fruit</dd - ></dl -><p ->Tight using tabs:</p -><dl -><dt - >apple</dt - ><dd - >red fruit</dd - ><dt - >orange</dt - ><dd - >orange fruit</dd - ><dt - >banana</dt - ><dd - >yellow fruit</dd - ></dl -><p ->Loose:</p -><dl -><dt - >apple</dt - ><dd - ><p - >red fruit</p - ></dd - ><dt - >orange</dt - ><dd - ><p - >orange fruit</p - ></dd - ><dt - >banana</dt - ><dd - ><p - >yellow fruit</p - ></dd - ></dl -><p ->Multiple blocks with italics:</p -><dl -><dt - ><em - >apple</em - ></dt - ><dd - ><p - >red fruit</p - ><p - >contains seeds, crisp, pleasant to taste</p - ></dd - ><dt - ><em - >orange</em - ></dt - ><dd - ><p - >orange fruit</p - ><pre - ><code - >{ orange code block } -</code - ></pre - ><blockquote - ><p - >orange block quote</p - ></blockquote - ></dd - ></dl -><p ->Multiple definitions, tight:</p -><dl -><dt - >apple</dt - ><dd - >red fruit</dd - ><dd - >computer</dd - ><dt - >orange</dt - ><dd - >orange fruit</dd - ><dd - >bank</dd - ></dl -><p ->Multiple definitions, loose:</p -><dl -><dt - >apple</dt - ><dd - ><p - >red fruit</p - ></dd - ><dd - ><p - >computer</p - ></dd - ><dt - >orange</dt - ><dd - ><p - >orange fruit</p - ></dd - ><dd - ><p - >bank</p - ></dd - ></dl -><p ->Blank line after term, indented marker, alternate markers:</p -><dl -><dt - >apple</dt - ><dd - ><p - >red fruit</p - ></dd - ><dd - ><p - >computer</p - ></dd - ><dt - >orange</dt - ><dd - ><p - >orange fruit</p - ><ol style="list-style-type: decimal" - ><li - >sublist</li - ><li - >sublist</li - ></ol - ></dd - ></dl -><h1 id="html-blocks" ->HTML Blocks</h1 -><p ->Simple block on one line:</p -><div>foo</div> -<p ->And nested without indentation:</p -><div> +</code></pre> +<hr /> +<h1 id="lists">Lists</h1> +<h2 id="unordered">Unordered</h2> +<p>Asterisks tight:</p> +<ul> +<li>asterisk 1</li> +<li>asterisk 2</li> +<li>asterisk 3</li> +</ul> +<p>Asterisks loose:</p> +<ul> +<li><p>asterisk 1</p></li> +<li><p>asterisk 2</p></li> +<li><p>asterisk 3</p></li> +</ul> +<p>Pluses tight:</p> +<ul> +<li>Plus 1</li> +<li>Plus 2</li> +<li>Plus 3</li> +</ul> +<p>Pluses loose:</p> +<ul> +<li><p>Plus 1</p></li> +<li><p>Plus 2</p></li> +<li><p>Plus 3</p></li> +</ul> +<p>Minuses tight:</p> +<ul> +<li>Minus 1</li> +<li>Minus 2</li> +<li>Minus 3</li> +</ul> +<p>Minuses loose:</p> +<ul> +<li><p>Minus 1</p></li> +<li><p>Minus 2</p></li> +<li><p>Minus 3</p></li> +</ul> +<h2 id="ordered">Ordered</h2> +<p>Tight:</p> +<ol style="list-style-type: decimal"> +<li>First</li> +<li>Second</li> +<li>Third</li> +</ol> +<p>and:</p> +<ol style="list-style-type: decimal"> +<li>One</li> +<li>Two</li> +<li>Three</li> +</ol> +<p>Loose using tabs:</p> +<ol style="list-style-type: decimal"> +<li><p>First</p></li> +<li><p>Second</p></li> +<li><p>Third</p></li> +</ol> +<p>and using spaces:</p> +<ol style="list-style-type: decimal"> +<li><p>One</p></li> +<li><p>Two</p></li> +<li><p>Three</p></li> +</ol> +<p>Multiple paragraphs:</p> +<ol style="list-style-type: decimal"> +<li><p>Item 1, graf one.</p> +<p>Item 1. graf two. The quick brown fox jumped over the lazy dog’s back.</p></li> +<li><p>Item 2.</p></li> +<li><p>Item 3.</p></li> +</ol> +<h2 id="nested">Nested</h2> +<ul> +<li>Tab +<ul> +<li>Tab +<ul> +<li>Tab</li> +</ul></li> +</ul></li> +</ul> +<p>Here’s another:</p> +<ol style="list-style-type: decimal"> +<li>First</li> +<li>Second: +<ul> +<li>Fee</li> +<li>Fie</li> +<li>Foe</li> +</ul></li> +<li>Third</li> +</ol> +<p>Same thing but with paragraphs:</p> +<ol style="list-style-type: decimal"> +<li><p>First</p></li> +<li><p>Second:</p> +<ul> +<li>Fee</li> +<li>Fie</li> +<li>Foe</li> +</ul></li> +<li><p>Third</p></li> +</ol> +<h2 id="tabs-and-spaces">Tabs and spaces</h2> +<ul> +<li><p>this is a list item indented with tabs</p></li> +<li><p>this is a list item indented with spaces</p> +<ul> +<li><p>this is an example list item indented with tabs</p></li> +<li><p>this is an example list item indented with spaces</p></li> +</ul></li> +</ul> +<h2 id="fancy-list-markers">Fancy list markers</h2> +<ol start="2" style="list-style-type: decimal"> +<li>begins with 2</li> +<li><p>and now 3</p> +<p>with a continuation</p> +<ol start="4" style="list-style-type: lower-roman"> +<li>sublist with roman numerals, starting with 4</li> +<li>more items +<ol style="list-style-type: upper-alpha"> +<li>a subsublist</li> +<li>a subsublist</li> +</ol></li> +</ol></li> +</ol> +<p>Nesting:</p> +<ol style="list-style-type: upper-alpha"> +<li>Upper Alpha +<ol style="list-style-type: upper-roman"> +<li>Upper Roman. +<ol start="6" style="list-style-type: decimal"> +<li>Decimal start with 6 +<ol start="3" style="list-style-type: lower-alpha"> +<li>Lower alpha with paren</li> +</ol></li> +</ol></li> +</ol></li> +</ol> +<p>Autonumbering:</p> +<ol> +<li>Autonumber.</li> +<li>More. +<ol> +<li>Nested.</li> +</ol></li> +</ol> +<p>Should not be a list item:</p> +<p>M.A. 2007</p> +<p>B. Williams</p> +<hr /> +<h1 id="definition-lists">Definition Lists</h1> +<p>Tight using spaces:</p> +<dl> +<dt>apple</dt> +<dd>red fruit +</dd> +<dt>orange</dt> +<dd>orange fruit +</dd> +<dt>banana</dt> +<dd>yellow fruit +</dd> +</dl> +<p>Tight using tabs:</p> +<dl> +<dt>apple</dt> +<dd>red fruit +</dd> +<dt>orange</dt> +<dd>orange fruit +</dd> +<dt>banana</dt> +<dd>yellow fruit +</dd> +</dl> +<p>Loose:</p> +<dl> +<dt>apple</dt> +<dd><p>red fruit</p> +</dd> +<dt>orange</dt> +<dd><p>orange fruit</p> +</dd> +<dt>banana</dt> +<dd><p>yellow fruit</p> +</dd> +</dl> +<p>Multiple blocks with italics:</p> +<dl> +<dt><em>apple</em></dt> +<dd><p>red fruit</p> +<p>contains seeds, crisp, pleasant to taste</p> +</dd> +<dt><em>orange</em></dt> +<dd><p>orange fruit</p> +<pre><code>{ orange code block } +</code></pre> +<blockquote> +<p>orange block quote</p> +</blockquote> +</dd> +</dl> +<p>Multiple definitions, tight:</p> +<dl> +<dt>apple</dt> +<dd>red fruit +</dd><dd>computer +</dd> +<dt>orange</dt> +<dd>orange fruit +</dd><dd>bank +</dd> +</dl> +<p>Multiple definitions, loose:</p> +<dl> +<dt>apple</dt> +<dd><p>red fruit</p> +</dd><dd><p>computer</p> +</dd> +<dt>orange</dt> +<dd><p>orange fruit</p> +</dd><dd><p>bank</p> +</dd> +</dl> +<p>Blank line after term, indented marker, alternate markers:</p> +<dl> +<dt>apple</dt> +<dd><p>red fruit</p> +</dd><dd><p>computer</p> +</dd> +<dt>orange</dt> +<dd><p>orange fruit</p> +<ol style="list-style-type: decimal"> +<li>sublist</li> +<li>sublist</li> +</ol> +</dd> +</dl> +<h1 id="html-blocks">HTML Blocks</h1> +<p>Simple block on one line:</p> <div> -<div>foo</div> +foo </div> -<div>bar</div> + +<p>And nested without indentation:</p> +<div> +<div> +<div> +foo </div> -<p ->Interpreted markdown in a table:</p -><table> +</div> +<div> +bar +</div> +</div> + +<p>Interpreted markdown in a table:</p> +<table> <tr> -<td>This is <em ->emphasized</em -></td> -<td>And this is <strong ->strong</strong -></td> +<td> +This is <em>emphasized</em> +</td> +<td> +And this is <strong>strong</strong> +</td> </tr> </table> <script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script> -<p ->Here’s a simple block:</p -><div> - foo</div> -<p ->This should be a code block, though:</p -><pre -><code - ><div> + +<p>Here’s a simple block:</p> +<div> + +foo +</div> + +<p>This should be a code block, though:</p> +<pre><code><div> foo </div> -</code - ></pre -><p ->As should this:</p -><pre -><code - ><div>foo</div> -</code - ></pre -><p ->Now, nested:</p -><div> +</code></pre> +<p>As should this:</p> +<pre><code><div>foo</div> +</code></pre> +<p>Now, nested:</p> +<div> <div> <div> - foo</div> + +foo +</div> </div> </div> -<p ->This should just be an HTML comment:</p -><!-- Comment --> -<p ->Multiline:</p -><!-- + +<p>This should just be an HTML comment:</p> +<!-- Comment --> + +<p>Multiline:</p> +<!-- Blah Blah --> @@ -635,26 +379,18 @@ Blah <!-- This is another comment. --> -<p ->Code block:</p -><pre -><code - ><!-- Comment --> -</code - ></pre -><p ->Just plain comment, with trailing spaces on the line:</p -><!-- foo --> -<p ->Code:</p -><pre -><code - ><hr /> -</code - ></pre -><p ->Hr’s:</p -><hr> + +<p>Code block:</p> +<pre><code><!-- Comment --> +</code></pre> +<p>Just plain comment, with trailing spaces on the line:</p> +<!-- foo --> + +<p>Code:</p> +<pre><code><hr /> +</code></pre> +<p>Hr’s:</p> +<hr> <hr /> @@ -671,493 +407,168 @@ Blah <hr class="foo" id="bar" /> <hr class="foo" id="bar"> -<hr - /><h1 id="inline-markup" ->Inline Markup</h1 -><p ->This is <em - >emphasized</em - >, and so <em - >is this</em - >.</p -><p ->This is <strong - >strong</strong - >, and so <strong - >is this</strong - >.</p -><p ->An <em - ><a href="/url" - >emphasized link</a - ></em - >.</p -><p -><strong - ><em - >This is strong and em.</em - ></strong - ></p -><p ->So is <strong - ><em - >this</em - ></strong - > word.</p -><p -><strong - ><em - >This is strong and em.</em - ></strong - ></p -><p ->So is <strong - ><em - >this</em - ></strong - > word.</p -><p ->This is code: <code - >></code - >, <code - >$</code - >, <code - >\</code - >, <code - >\$</code - >, <code - ><html></code - >.</p -><p -><span style="text-decoration: line-through;" - >This is <em - >strikeout</em - >.</span - ></p -><p ->Superscripts: a<sup - >bc</sup - >d a<sup - ><em - >hello</em - ></sup - > a<sup - >hello there</sup - >.</p -><p ->Subscripts: H<sub - >2</sub - >O, H<sub - >23</sub - >O, H<sub - >many of them</sub - >O.</p -><p ->These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.</p -><hr - /><h1 id="smart-quotes-ellipses-dashes" ->Smart quotes, ellipses, dashes</h1 -><p ->“Hello,” said the spider. “‘Shelob’ is my name.”</p -><p ->‘A’, ‘B’, and ‘C’ are letters.</p -><p ->‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’</p -><p ->‘He said, “I want to go.”’ Were you alive in the 70’s?</p -><p ->Here is some quoted ‘<code - >code</code - >’ and a “<a href="http://example.com/?foo=1&bar=2" - >quoted link</a - >”.</p -><p ->Some dashes: one—two — three—four — five.</p -><p ->Dashes between numbers: 5–7, 255–66, 1987–1999.</p -><p ->Ellipses…and…and….</p -><hr - /><h1 id="latex" ->LaTeX</h1 -><ul -><li - ></li - ><li - ><span class="math" - >2 + 2 = 4</span - ></li - ><li - ><span class="math" - ><em - >x</em - > ∈ <em - >y</em - ></span - ></li - ><li - ><span class="math" - >α ∧ ω</span - ></li - ><li - ><span class="math" - >223</span - ></li - ><li - ><span class="math" - ><em - >p</em - ></span - >-Tree</li - ><li - >Here’s some display math: <br - /><span class="math" - >$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</span - ><br - /></li - ><li - >Here’s one that has a line break in it: <span class="math" - >α + ω × <em - >x</em - ><sup - >2</sup - ></span - >.</li - ></ul -><p ->These shouldn’t be math:</p -><ul -><li - >To get the famous equation, write <code - >$e = mc^2$</code - >.</li - ><li - >$22,000 is a <em - >lot</em - > of money. So is $34,000. (It worked if “lot” is emphasized.)</li - ><li - >Shoes ($20) and socks ($5).</li - ><li - >Escaped <code - >$</code - >: $73 <em - >this should be emphasized</em - > 23$.</li - ></ul -><p ->Here’s a LaTeX table:</p -><hr - /><h1 id="special-characters" ->Special Characters</h1 -><p ->Here is some unicode:</p -><ul -><li - >I hat: Î</li - ><li - >o umlaut: ö</li - ><li - >section: §</li - ><li - >set membership: ∈</li - ><li - >copyright: ©</li - ></ul -><p ->AT&T has an ampersand in their name.</p -><p ->AT&T is another way to write it.</p -><p ->This & that.</p -><p ->4 < 5.</p -><p ->6 > 5.</p -><p ->Backslash: \</p -><p ->Backtick: `</p -><p ->Asterisk: *</p -><p ->Underscore: _</p -><p ->Left brace: {</p -><p ->Right brace: }</p -><p ->Left bracket: [</p -><p ->Right bracket: ]</p -><p ->Left paren: (</p -><p ->Right paren: )</p -><p ->Greater-than: ></p -><p ->Hash: #</p -><p ->Period: .</p -><p ->Bang: !</p -><p ->Plus: +</p -><p ->Minus: -</p -><hr - /><h1 id="links" ->Links</h1 -><h2 id="explicit" ->Explicit</h2 -><p ->Just a <a href="/url/" - >URL</a - >.</p -><p -><a href="/url/" title="title" - >URL and title</a - >.</p -><p -><a href="/url/" title="title preceded by two spaces" - >URL and title</a - >.</p -><p -><a href="/url/" title="title preceded by a tab" - >URL and title</a - >.</p -><p -><a href="/url/" title="title with "quotes" in it" - >URL and title</a - ></p -><p -><a href="/url/" title="title with single quotes" - >URL and title</a - ></p -><p -><a href="/url/with_underscore" - >with_underscore</a - ></p -><p -><script type="text/javascript" - > + +<hr /> +<h1 id="inline-markup">Inline Markup</h1> +<p>This is <em>emphasized</em>, and so <em>is this</em>.</p> +<p>This is <strong>strong</strong>, and so <strong>is this</strong>.</p> +<p>An <em><a href="/url">emphasized link</a></em>.</p> +<p><strong><em>This is strong and em.</em></strong></p> +<p>So is <strong><em>this</em></strong> word.</p> +<p><strong><em>This is strong and em.</em></strong></p> +<p>So is <strong><em>this</em></strong> word.</p> +<p>This is code: <code>></code>, <code>$</code>, <code>\</code>, <code>\$</code>, <code><html></code>.</p> +<p><span style="text-decoration: line-through;">This is <em>strikeout</em>.</span></p> +<p>Superscripts: a<sup>bc</sup>d a<sup><em>hello</em></sup> a<sup>hello there</sup>.</p> +<p>Subscripts: H<sub>2</sub>O, H<sub>23</sub>O, H<sub>many of them</sub>O.</p> +<p>These should not be superscripts or subscripts, because of the unescaped spaces: a^b c^d, a~b c~d.</p> +<hr /> +<h1 id="smart-quotes-ellipses-dashes">Smart quotes, ellipses, dashes</h1> +<p>“Hello,” said the spider. “‘Shelob’ is my name.”</p> +<p>‘A’, ‘B’, and ‘C’ are letters.</p> +<p>‘Oak,’ ‘elm,’ and ‘beech’ are names of trees. So is ‘pine.’</p> +<p>‘He said, “I want to go.”’ Were you alive in the 70’s?</p> +<p>Here is some quoted ‘<code>code</code>’ and a “<a href="http://example.com/?foo=1&bar=2">quoted link</a>”.</p> +<p>Some dashes: one—two — three—four — five.</p> +<p>Dashes between numbers: 5–7, 255–66, 1987–1999.</p> +<p>Ellipses…and…and….</p> +<hr /> +<h1 id="latex">LaTeX</h1> +<ul> +<li></li> +<li><span class="math">2 + 2 = 4</span></li> +<li><span class="math"><em>x</em> ∈ <em>y</em></span></li> +<li><span class="math">α ∧ ω</span></li> +<li><span class="math">223</span></li> +<li><span class="math"><em>p</em></span>-Tree</li> +<li>Here’s some display math: <br /><span class="math">$\frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h}$</span><br /></li> +<li>Here’s one that has a line break in it: <span class="math">α + ω × <em>x</em><sup>2</sup></span>.</li> +</ul> +<p>These shouldn’t be math:</p> +<ul> +<li>To get the famous equation, write <code>$e = mc^2$</code>.</li> +<li>$22,000 is a <em>lot</em> of money. So is $34,000. (It worked if “lot” is emphasized.)</li> +<li>Shoes ($20) and socks ($5).</li> +<li>Escaped <code>$</code>: $73 <em>this should be emphasized</em> 23$.</li> +</ul> +<p>Here’s a LaTeX table:</p> + +<hr /> +<h1 id="special-characters">Special Characters</h1> +<p>Here is some unicode:</p> +<ul> +<li>I hat: Î</li> +<li>o umlaut: ö</li> +<li>section: §</li> +<li>set membership: ∈</li> +<li>copyright: ©</li> +</ul> +<p>AT&T has an ampersand in their name.</p> +<p>AT&T is another way to write it.</p> +<p>This & that.</p> +<p>4 < 5.</p> +<p>6 > 5.</p> +<p>Backslash: \</p> +<p>Backtick: `</p> +<p>Asterisk: *</p> +<p>Underscore: _</p> +<p>Left brace: {</p> +<p>Right brace: }</p> +<p>Left bracket: [</p> +<p>Right bracket: ]</p> +<p>Left paren: (</p> +<p>Right paren: )</p> +<p>Greater-than: ></p> +<p>Hash: #</p> +<p>Period: .</p> +<p>Bang: !</p> +<p>Plus: +</p> +<p>Minus: -</p> +<hr /> +<h1 id="links">Links</h1> +<h2 id="explicit">Explicit</h2> +<p>Just a <a href="/url/">URL</a>.</p> +<p><a href="/url/" title="title">URL and title</a>.</p> +<p><a href="/url/" title="title preceded by two spaces">URL and title</a>.</p> +<p><a href="/url/" title="title preceded by a tab">URL and title</a>.</p> +<p><a href="/url/" title="title with "quotes" in it">URL and title</a></p> +<p><a href="/url/" title="title with single quotes">URL and title</a></p> +<p><a href="/url/with_underscore">with_underscore</a></p> +<p><script type="text/javascript"> <!-- h='nowhere.net';a='@';n='nobody';e=n+a+h; document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'Email link'+'<\/'+'a'+'>'); // --> -</script - ><noscript - >Email link (nobody at nowhere dot net)</noscript - ></p -><p -><a href="" - >Empty</a - >.</p -><h2 id="reference" ->Reference</h2 -><p ->Foo <a href="/url/" - >bar</a - >.</p -><p ->Foo <a href="/url/" - >bar</a - >.</p -><p ->Foo <a href="/url/" - >bar</a - >.</p -><p ->With <a href="/url/" - >embedded [brackets]</a - >.</p -><p -><a href="/url/" - >b</a - > by itself should be a link.</p -><p ->Indented <a href="/url" - >once</a - >.</p -><p ->Indented <a href="/url" - >twice</a - >.</p -><p ->Indented <a href="/url" - >thrice</a - >.</p -><p ->This should [not][] be a link.</p -><pre -><code - >[not]: /url -</code - ></pre -><p ->Foo <a href="/url/" title="Title with "quotes" inside" - >bar</a - >.</p -><p ->Foo <a href="/url/" title="Title with "quote" inside" - >biz</a - >.</p -><h2 id="with-ampersands" ->With ampersands</h2 -><p ->Here’s a <a href="http://example.com/?foo=1&bar=2" - >link with an ampersand in the URL</a - >.</p -><p ->Here’s a link with an amersand in the link text: <a href="http://att.com/" title="AT&T" - >AT&T</a - >.</p -><p ->Here’s an <a href="/script?foo=1&bar=2" - >inline link</a - >.</p -><p ->Here’s an <a href="/script?foo=1&bar=2" - >inline link in pointy braces</a - >.</p -><h2 id="autolinks" ->Autolinks</h2 -><p ->With an ampersand: <a href="http://example.com/?foo=1&bar=2" - ><code class="url" - >http://example.com/?foo=1&bar=2</code - ></a - ></p -><ul -><li - >In a list?</li - ><li - ><a href="http://example.com/" - ><code class="url" - >http://example.com/</code - ></a - ></li - ><li - >It should.</li - ></ul -><p ->An e-mail address: <script type="text/javascript" - > +</script><noscript>Email link (nobody at nowhere dot net)</noscript></p> +<p><a href="">Empty</a>.</p> +<h2 id="reference">Reference</h2> +<p>Foo <a href="/url/">bar</a>.</p> +<p>Foo <a href="/url/">bar</a>.</p> +<p>Foo <a href="/url/">bar</a>.</p> +<p>With <a href="/url/">embedded [brackets]</a>.</p> +<p><a href="/url/">b</a> by itself should be a link.</p> +<p>Indented <a href="/url">once</a>.</p> +<p>Indented <a href="/url">twice</a>.</p> +<p>Indented <a href="/url">thrice</a>.</p> +<p>This should [not][] be a link.</p> +<pre><code>[not]: /url +</code></pre> +<p>Foo <a href="/url/" title="Title with "quotes" inside">bar</a>.</p> +<p>Foo <a href="/url/" title="Title with "quote" inside">biz</a>.</p> +<h2 id="with-ampersands">With ampersands</h2> +<p>Here’s a <a href="http://example.com/?foo=1&bar=2">link with an ampersand in the URL</a>.</p> +<p>Here’s a link with an amersand in the link text: <a href="http://att.com/" title="AT&T">AT&T</a>.</p> +<p>Here’s an <a href="/script?foo=1&bar=2">inline link</a>.</p> +<p>Here’s an <a href="/script?foo=1&bar=2">inline link in pointy braces</a>.</p> +<h2 id="autolinks">Autolinks</h2> +<p>With an ampersand: <a href="http://example.com/?foo=1&bar=2"><code class="url">http://example.com/?foo=1&bar=2</code></a></p> +<ul> +<li>In a list?</li> +<li><a href="http://example.com/"><code class="url">http://example.com/</code></a></li> +<li>It should.</li> +</ul> +<p>An e-mail address: <script type="text/javascript"> <!-- h='nowhere.net';a='@';n='nobody';e=n+a+h; document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'">'+'<code>'+e+'</code>'+'<\/'+'a'+'>'); // --> -</script - ><noscript - >nobody at nowhere dot net</noscript - ></p -><blockquote -><p - >Blockquoted: <a href="http://example.com/" - ><code class="url" - >http://example.com/</code - ></a - ></p - ></blockquote -><p ->Auto-links should not occur here: <code - ><http://example.com/></code - ></p -><pre -><code - >or here: <http://example.com/> -</code - ></pre -><hr - /><h1 id="images" ->Images</h1 -><p ->From “Voyage dans la Lune” by Georges Melies (1902):</p -><div class="figure" -><img src="lalune.jpg" title="Voyage dans la Lune" alt="lalune" - /><p class="caption" - >lalune</p - ></div -><p ->Here is a movie <img src="movie.jpg" alt="movie" - /> icon.</p -><hr - /><h1 id="footnotes" ->Footnotes</h1 -><p ->Here is a footnote reference,<sup - ><a href="#fn1" class="footnoteRef" id="fnref1" - >1</a - ></sup - > and another.<sup - ><a href="#fn2" class="footnoteRef" id="fnref2" - >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 - ><a href="#fn3" class="footnoteRef" id="fnref3" - >3</a - ></sup - ></p -><blockquote -><p - >Notes can go in quotes.<sup - ><a href="#fn4" class="footnoteRef" id="fnref4" - >4</a - ></sup - ></p - ></blockquote -><ol style="list-style-type: decimal" -><li - >And in list items.<sup - ><a href="#fn5" class="footnoteRef" id="fnref5" - >5</a - ></sup - ></li - ></ol -><p ->This paragraph should not be part of the note, as it is not indented.</p -><div class="footnotes" -><hr - /><ol - ><li id="fn1" - ><p - >Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document. <a href="#fnref1" class="footnoteBackLink" title="Jump back to footnote 1">↩</a></p - ></li - ><li id="fn2" - ><p - >Here’s the long note. This one contains multiple blocks.</p - ><p - >Subsequent blocks are indented to show that they belong to the footnote (as with list items).</p - ><pre - ><code - > { <code> } -</code - ></pre - ><p - >If you want, you can indent every line, but you can also be lazy and just indent the first line of each block. <a href="#fnref2" class="footnoteBackLink" title="Jump back to footnote 2">↩</a></p - ></li - ><li id="fn3" - ><p - >This is <em - >easier</em - > to type. Inline notes may contain <a href="http://google.com" - >links</a - > and <code - >]</code - > verbatim characters, as well as [bracketed text]. <a href="#fnref3" class="footnoteBackLink" title="Jump back to footnote 3">↩</a></p - ></li - ><li id="fn4" - ><p - >In quote. <a href="#fnref4" class="footnoteBackLink" title="Jump back to footnote 4">↩</a></p - ></li - ><li id="fn5" - ><p - >In list. <a href="#fnref5" class="footnoteBackLink" title="Jump back to footnote 5">↩</a></p - ></li - ></ol - ></div -> +</script><noscript>nobody at nowhere dot net</noscript></p> +<blockquote> +<p>Blockquoted: <a href="http://example.com/"><code class="url">http://example.com/</code></a></p> +</blockquote> +<p>Auto-links should not occur here: <code><http://example.com/></code></p> +<pre><code>or here: <http://example.com/> +</code></pre> +<hr /> +<h1 id="images">Images</h1> +<p>From “Voyage dans la Lune” by Georges Melies (1902):</p> +<div class="figure"> +<img src="lalune.jpg" title="Voyage dans la Lune" alt="lalune" /><p class="caption">lalune</p> +</div> +<p>Here is a movie <img src="movie.jpg" alt="movie" /> icon.</p> +<hr /> +<h1 id="footnotes">Footnotes</h1> +<p>Here is a footnote reference,<sup><a href="#fn1" class="footnoteRef" id="fnref1">1</a></sup> and another.<sup><a href="#fn2" class="footnoteRef" id="fnref2">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><a href="#fn3" class="footnoteRef" id="fnref3">3</a></sup></p> +<blockquote> +<p>Notes can go in quotes.<sup><a href="#fn4" class="footnoteRef" id="fnref4">4</a></sup></p> +</blockquote> +<ol style="list-style-type: decimal"> +<li>And in list items.<sup><a href="#fn5" class="footnoteRef" id="fnref5">5</a></sup></li> +</ol> +<p>This paragraph should not be part of the note, as it is not indented.</p> +<div class="footnotes"> +<hr /> +<ol> +<li id="fn1"><p>Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document. <a href="#fnref1" class="footnoteBackLink" title="Jump back to footnote 1">↩</a></p></li> +<li id="fn2"><p>Here’s the long note. This one contains multiple blocks.</p> +<p>Subsequent blocks are indented to show that they belong to the footnote (as with list items).</p> +<pre><code> { <code> } +</code></pre> +<p>If you want, you can indent every line, but you can also be lazy and just indent the first line of each block. <a href="#fnref2" class="footnoteBackLink" title="Jump back to footnote 2">↩</a></p></li> +<li id="fn3"><p>This is <em>easier</em> to type. Inline notes may contain <a href="http://google.com">links</a> and <code>]</code> verbatim characters, as well as [bracketed text]. <a href="#fnref3" class="footnoteBackLink" title="Jump back to footnote 3">↩</a></p></li> +<li id="fn4"><p>In quote. <a href="#fnref4" class="footnoteBackLink" title="Jump back to footnote 4">↩</a></p></li> +<li id="fn5"><p>In list. <a href="#fnref5" class="footnoteBackLink" title="Jump back to footnote 5">↩</a></p></li> +</ol> +</div> </body> </html> |