Adjusted writers and tests for change in parsing of div/span.
Textile, MediaWiki, Markdown, Org, RST will emit raw HTML div tags for divs. Otherwise Div and Span are "transparent" block containers.
This commit is contained in:
parent
3117c668a7
commit
8d441af3da
20 changed files with 232 additions and 119 deletions
|
@ -149,7 +149,7 @@ listItemToDocbook opts item =
|
|||
-- | Convert a Pandoc block element to Docbook.
|
||||
blockToDocbook :: WriterOptions -> Block -> Doc
|
||||
blockToDocbook _ Null = empty
|
||||
blockToDocbook opts (Div _ bs) = blocksToDocbook opts bs
|
||||
blockToDocbook opts (Div _ bs) = blocksToDocbook opts $ map plainToPara bs
|
||||
blockToDocbook _ (Header _ _ _) = empty -- should not occur after hierarchicalize
|
||||
blockToDocbook opts (Plain lst) = inlinesToDocbook opts lst
|
||||
-- title beginning with fig: indicates that the image is a figure
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{-# LANGUAGE OverloadedStrings, TupleSections, ScopedTypeVariables #-}
|
||||
{-
|
||||
Copyright (C) 2006-2010 John MacFarlane <jgm@berkeley.edu>
|
||||
Copyright (C) 2006-2013 John MacFarlane <jgm@berkeley.edu>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
|
@ -19,7 +19,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||
|
||||
{- |
|
||||
Module : Text.Pandoc.Writers.Markdown
|
||||
Copyright : Copyright (C) 2006-2010 John MacFarlane
|
||||
Copyright : Copyright (C) 2006-2013 John MacFarlane
|
||||
License : GNU GPL, version 2 or above
|
||||
|
||||
Maintainer : John MacFarlane <jgm@berkeley.edu>
|
||||
|
@ -301,7 +301,13 @@ blockToMarkdown :: WriterOptions -- ^ Options
|
|||
-> Block -- ^ Block element
|
||||
-> State WriterState Doc
|
||||
blockToMarkdown _ Null = return empty
|
||||
blockToMarkdown opts (Div _ bs) = blockListToMarkdown opts bs
|
||||
blockToMarkdown opts (Div attrs ils) = do
|
||||
isPlain <- gets stPlain
|
||||
contents <- blockListToMarkdown opts ils
|
||||
return $ if isPlain
|
||||
then contents <> blankline
|
||||
else tagWithAttrs "div" attrs <> blankline <>
|
||||
contents <> blankline <> "</div>" <> blankline
|
||||
blockToMarkdown opts (Plain inlines) = do
|
||||
contents <- inlineListToMarkdown opts inlines
|
||||
return $ contents <> cr
|
||||
|
@ -629,8 +635,9 @@ escapeSpaces x = x
|
|||
|
||||
-- | Convert Pandoc inline element to markdown.
|
||||
inlineToMarkdown :: WriterOptions -> Inline -> State WriterState Doc
|
||||
inlineToMarkdown opts (Span _ ils) =
|
||||
inlineListToMarkdown opts ils
|
||||
inlineToMarkdown opts (Span attrs ils) = do
|
||||
contents <- inlineListToMarkdown opts ils
|
||||
return $ tagWithAttrs "span" attrs <> contents <> text "</span>"
|
||||
inlineToMarkdown opts (Emph lst) = do
|
||||
contents <- inlineListToMarkdown opts lst
|
||||
return $ "*" <> contents <> "*"
|
||||
|
|
|
@ -34,6 +34,7 @@ import Text.Pandoc.Definition
|
|||
import Text.Pandoc.Options
|
||||
import Text.Pandoc.Shared
|
||||
import Text.Pandoc.Writers.Shared
|
||||
import Text.Pandoc.Pretty (render)
|
||||
import Text.Pandoc.Templates (renderTemplate')
|
||||
import Text.Pandoc.XML ( escapeStringForXML )
|
||||
import Data.List ( intersect, intercalate, intersperse )
|
||||
|
@ -83,8 +84,10 @@ blockToMediaWiki :: WriterOptions -- ^ Options
|
|||
|
||||
blockToMediaWiki _ Null = return ""
|
||||
|
||||
blockToMediaWiki opts (Div _ bs) =
|
||||
blockListToMediaWiki opts bs
|
||||
blockToMediaWiki opts (Div attrs bs) = do
|
||||
contents <- blockListToMediaWiki opts bs
|
||||
return $ render Nothing (tagWithAttrs "div" attrs) ++ "\n\n" ++
|
||||
contents ++ "\n\n" ++ "</div>"
|
||||
|
||||
blockToMediaWiki opts (Plain inlines) =
|
||||
inlineListToMediaWiki opts inlines
|
||||
|
@ -332,8 +335,9 @@ inlineListToMediaWiki opts lst =
|
|||
-- | Convert Pandoc inline element to MediaWiki.
|
||||
inlineToMediaWiki :: WriterOptions -> Inline -> State WriterState String
|
||||
|
||||
inlineToMediaWiki opts (Span _ ils) =
|
||||
inlineListToMediaWiki opts ils
|
||||
inlineToMediaWiki opts (Span attrs ils) = do
|
||||
contents <- inlineListToMediaWiki opts ils
|
||||
return $ render Nothing (tagWithAttrs "span" attrs) ++ contents ++ "</span>"
|
||||
|
||||
inlineToMediaWiki opts (Emph lst) = do
|
||||
contents <- inlineListToMediaWiki opts lst
|
||||
|
|
|
@ -106,7 +106,14 @@ escapeString = escapeStringUsing $
|
|||
blockToOrg :: Block -- ^ Block element
|
||||
-> State WriterState Doc
|
||||
blockToOrg Null = return empty
|
||||
blockToOrg (Div _ bs) = blockListToOrg bs
|
||||
blockToOrg (Div attrs bs) = do
|
||||
contents <- blockListToOrg bs
|
||||
let startTag = tagWithAttrs "div" attrs
|
||||
let endTag = text "</div>"
|
||||
return $ blankline $$ "#+BEGIN_HTML" $$
|
||||
nest 2 startTag $$ "#+END_HTML" $$ blankline $$
|
||||
contents $$ blankline $$ "#+BEGIN_HTML" $$
|
||||
nest 2 endTag $$ "#+END_HTML" $$ blankline
|
||||
blockToOrg (Plain inlines) = inlineListToOrg inlines
|
||||
-- title beginning with fig: indicates that the image is a figure
|
||||
blockToOrg (Para [Image txt (src,'f':'i':'g':':':tit)]) = do
|
||||
|
|
|
@ -161,7 +161,11 @@ bordered contents c =
|
|||
blockToRST :: Block -- ^ Block element
|
||||
-> State WriterState Doc
|
||||
blockToRST Null = return empty
|
||||
blockToRST (Div _ bs) = blockListToRST bs
|
||||
blockToRST (Div attr bs) = do
|
||||
contents <- blockListToRST bs
|
||||
let startTag = ".. raw:: html" $+$ nest 3 (tagWithAttrs "div" attr)
|
||||
let endTag = ".. raw:: html" $+$ nest 3 "</div>"
|
||||
return $ blankline <> startTag $+$ contents $+$ endTag $$ blankline
|
||||
blockToRST (Plain inlines) = inlineListToRST inlines
|
||||
-- title beginning with fig: indicates that the image is a figure
|
||||
blockToRST (Para [Image txt (src,'f':'i':'g':':':tit)]) = do
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
{-# LANGUAGE OverloadedStrings #-}
|
||||
{-
|
||||
Copyright (C) 2013 John MacFarlane <jgm@berkeley.edu>
|
||||
|
||||
|
@ -32,9 +33,12 @@ module Text.Pandoc.Writers.Shared (
|
|||
, getField
|
||||
, setField
|
||||
, defField
|
||||
, tagWithAttrs
|
||||
)
|
||||
where
|
||||
import Text.Pandoc.Definition
|
||||
import Text.Pandoc.Pretty
|
||||
import Text.Pandoc.XML (escapeStringForXML)
|
||||
import Control.Monad (liftM)
|
||||
import Text.Pandoc.Options (WriterOptions(..))
|
||||
import qualified Data.HashMap.Strict as H
|
||||
|
@ -120,3 +124,17 @@ defField field val (Object hashmap) =
|
|||
where f _newval oldval = oldval
|
||||
defField _ _ x = x
|
||||
|
||||
-- Produce an HTML tag with the given pandoc attributes.
|
||||
tagWithAttrs :: String -> Attr -> Doc
|
||||
tagWithAttrs tag (ident,classes,kvs) = hsep
|
||||
["<" <> text tag
|
||||
,if null ident
|
||||
then empty
|
||||
else "id=" <> doubleQuotes (text ident)
|
||||
,if null classes
|
||||
then empty
|
||||
else "class=" <> doubleQuotes (text (unwords classes))
|
||||
]
|
||||
<> hsep (map (\(k,v) -> text k <> "=" <>
|
||||
doubleQuotes (text (escapeStringForXML v))) kvs)
|
||||
<> ">"
|
||||
|
|
|
@ -33,6 +33,7 @@ module Text.Pandoc.Writers.Textile ( writeTextile ) where
|
|||
import Text.Pandoc.Definition
|
||||
import Text.Pandoc.Options
|
||||
import Text.Pandoc.Shared
|
||||
import Text.Pandoc.Pretty (render)
|
||||
import Text.Pandoc.Writers.Shared
|
||||
import Text.Pandoc.Templates (renderTemplate')
|
||||
import Text.Pandoc.XML ( escapeStringForXML )
|
||||
|
@ -101,8 +102,11 @@ blockToTextile :: WriterOptions -- ^ Options
|
|||
|
||||
blockToTextile _ Null = return ""
|
||||
|
||||
blockToTextile opts (Div _ bs) =
|
||||
blockListToTextile opts bs
|
||||
blockToTextile opts (Div attr bs) = do
|
||||
let startTag = render Nothing $ tagWithAttrs "div" attr
|
||||
let endTag = "</div>"
|
||||
contents <- blockListToTextile opts bs
|
||||
return $ startTag ++ "\n\n" ++ contents ++ "\n\n" ++ endTag ++ "\n"
|
||||
|
||||
blockToTextile opts (Plain inlines) =
|
||||
inlineListToTextile opts inlines
|
||||
|
|
|
@ -228,15 +228,9 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa
|
|||
,[Plain [Str "sublist"]]]]])]
|
||||
,Header 1 ("html-blocks",[],[]) [Str "HTML",Space,Str "Blocks"]
|
||||
,Para [Str "Simple",Space,Str "block",Space,Str "on",Space,Str "one",Space,Str "line:"]
|
||||
,RawBlock (Format "html") "<div>"
|
||||
,Plain [Str "foo"]
|
||||
,RawBlock (Format "html") "</div>\n"
|
||||
,Div ("",[],[]) [Plain [Str "foo"]]
|
||||
,Para [Str "And",Space,Str "nested",Space,Str "without",Space,Str "indentation:"]
|
||||
,RawBlock (Format "html") "<div>\n<div>\n<div>"
|
||||
,Plain [Str "foo"]
|
||||
,RawBlock (Format "html") "</div>\n</div>\n<div>"
|
||||
,Plain [Str "bar"]
|
||||
,RawBlock (Format "html") "</div>\n</div>\n"
|
||||
,Div ("",[],[]) [Div ("",[],[]) [Div ("",[],[]) [Plain [Str "foo"]]],Div ("",[],[]) [Plain [Str "bar"]]]
|
||||
,Para [Str "Interpreted",Space,Str "markdown",Space,Str "in",Space,Str "a",Space,Str "table:"]
|
||||
,RawBlock (Format "html") "<table>\n<tr>\n<td>"
|
||||
,Plain [Str "This",Space,Str "is",Space,Emph [Str "emphasized"]]
|
||||
|
@ -244,17 +238,13 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa
|
|||
,Plain [Str "And",Space,Str "this",Space,Str "is",Space,Strong [Str "strong"]]
|
||||
,RawBlock (Format "html") "</td>\n</tr>\n</table>\n\n<script type=\"text/javascript\">document.write('This *should not* be interpreted as markdown');</script>\n"
|
||||
,Para [Str "Here\8217s",Space,Str "a",Space,Str "simple",Space,Str "block:"]
|
||||
,RawBlock (Format "html") "<div>\n "
|
||||
,Plain [Str "foo"]
|
||||
,RawBlock (Format "html") "</div>\n"
|
||||
,Div ("",[],[]) [Plain [Str "foo"]]
|
||||
,Para [Str "This",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "code",Space,Str "block,",Space,Str "though:"]
|
||||
,CodeBlock ("",[],[]) "<div>\n foo\n</div>"
|
||||
,Para [Str "As",Space,Str "should",Space,Str "this:"]
|
||||
,CodeBlock ("",[],[]) "<div>foo</div>"
|
||||
,Para [Str "Now,",Space,Str "nested:"]
|
||||
,RawBlock (Format "html") "<div>\n <div>\n <div>\n "
|
||||
,Plain [Str "foo"]
|
||||
,RawBlock (Format "html") "</div>\n </div>\n</div>\n"
|
||||
,Div ("",[],[]) [Div ("",[],[]) [Div ("",[],[]) [Plain [Str "foo"]]]]
|
||||
,Para [Str "This",Space,Str "should",Space,Str "just",Space,Str "be",Space,Str "an",Space,Str "HTML",Space,Str "comment:"]
|
||||
,RawBlock (Format "html") "<!-- Comment -->\n"
|
||||
,Para [Str "Multiline:"]
|
||||
|
|
|
@ -377,7 +377,7 @@ Interpreted markdown in a table:
|
|||
Here's a simple block:
|
||||
|
||||
<div>
|
||||
foo
|
||||
foo
|
||||
</div>
|
||||
|
||||
This should be a code block, though:
|
||||
|
@ -393,11 +393,11 @@ As should this:
|
|||
Now, nested:
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<div>
|
||||
foo
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div>
|
||||
foo
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
This should just be an HTML comment:
|
||||
|
|
|
@ -862,22 +862,18 @@ These should not be escaped: \$ \\ \> \[ \{
|
|||
<para>
|
||||
Simple block on one line:
|
||||
</para>
|
||||
<div>
|
||||
foo
|
||||
</div>
|
||||
<para>
|
||||
foo
|
||||
</para>
|
||||
<para>
|
||||
And nested without indentation:
|
||||
</para>
|
||||
<div>
|
||||
<div>
|
||||
<div>
|
||||
foo
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
bar
|
||||
</div>
|
||||
</div>
|
||||
<para>
|
||||
foo
|
||||
</para>
|
||||
<para>
|
||||
bar
|
||||
</para>
|
||||
<para>
|
||||
Interpreted markdown in a table:
|
||||
</para>
|
||||
|
@ -896,10 +892,9 @@ These should not be escaped: \$ \\ \> \[ \{
|
|||
<para>
|
||||
Here’s a simple block:
|
||||
</para>
|
||||
<div>
|
||||
|
||||
foo
|
||||
</div>
|
||||
<para>
|
||||
foo
|
||||
</para>
|
||||
<para>
|
||||
This should be a code block, though:
|
||||
</para>
|
||||
|
@ -917,14 +912,9 @@ These should not be escaped: \$ \\ \> \[ \{
|
|||
<para>
|
||||
Now, nested:
|
||||
</para>
|
||||
<div>
|
||||
<div>
|
||||
<div>
|
||||
|
||||
foo
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<para>
|
||||
foo
|
||||
</para>
|
||||
<para>
|
||||
This should just be an HTML comment:
|
||||
</para>
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -324,7 +324,6 @@ These should not be escaped: \$ \\ \> \[ \{</code></pre>
|
|||
<div>
|
||||
foo
|
||||
</div>
|
||||
|
||||
<p>And nested without indentation:</p>
|
||||
<div>
|
||||
<div>
|
||||
|
@ -336,7 +335,6 @@ foo
|
|||
bar
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p>Interpreted markdown in a table:</p>
|
||||
<table>
|
||||
<tr>
|
||||
|
@ -353,10 +351,8 @@ And this is <strong>strong</strong>
|
|||
|
||||
<p>Here’s a simple block:</p>
|
||||
<div>
|
||||
|
||||
foo
|
||||
</div>
|
||||
|
||||
<p>This should be a code block, though:</p>
|
||||
<pre><code><div>
|
||||
foo
|
||||
|
@ -365,14 +361,12 @@ foo
|
|||
<pre><code><div>foo</div></code></pre>
|
||||
<p>Now, nested:</p>
|
||||
<div>
|
||||
<div>
|
||||
<div>
|
||||
|
||||
<div>
|
||||
<div>
|
||||
foo
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<p>This should just be an HTML comment:</p>
|
||||
<!-- Comment -->
|
||||
|
||||
|
|
|
@ -356,20 +356,31 @@ HTML Blocks
|
|||
Simple block on one line:
|
||||
|
||||
<div>
|
||||
|
||||
foo
|
||||
|
||||
</div>
|
||||
|
||||
And nested without indentation:
|
||||
|
||||
<div>
|
||||
|
||||
<div>
|
||||
|
||||
<div>
|
||||
|
||||
foo
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
||||
bar
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
Interpreted markdown in a table:
|
||||
|
@ -390,8 +401,9 @@ And this is **strong**
|
|||
Here’s a simple block:
|
||||
|
||||
<div>
|
||||
|
||||
|
||||
foo
|
||||
|
||||
</div>
|
||||
|
||||
This should be a code block, though:
|
||||
|
@ -407,12 +419,17 @@ As should this:
|
|||
Now, nested:
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<div>
|
||||
|
||||
|
||||
<div>
|
||||
|
||||
<div>
|
||||
|
||||
foo
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
This should just be an HTML comment:
|
||||
|
|
|
@ -311,22 +311,30 @@ Blank line after term, indented marker, alternate markers:
|
|||
Simple block on one line:
|
||||
|
||||
<div>
|
||||
foo
|
||||
</div>
|
||||
|
||||
foo
|
||||
|
||||
</div>
|
||||
And nested without indentation:
|
||||
|
||||
<div>
|
||||
|
||||
<div>
|
||||
|
||||
<div>
|
||||
|
||||
foo
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
bar
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div>
|
||||
|
||||
bar
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
Interpreted markdown in a table:
|
||||
|
||||
<table>
|
||||
|
@ -345,10 +353,10 @@ And this is '''strong'''
|
|||
Here’s a simple block:
|
||||
|
||||
<div>
|
||||
|
||||
foo
|
||||
</div>
|
||||
|
||||
foo
|
||||
|
||||
</div>
|
||||
This should be a code block, though:
|
||||
|
||||
<pre><div>
|
||||
|
@ -360,14 +368,18 @@ As should this:
|
|||
Now, nested:
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<div>
|
||||
|
||||
|
||||
<div>
|
||||
|
||||
<div>
|
||||
|
||||
foo
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
This should just be an HTML comment:
|
||||
|
||||
<!-- Comment -->
|
||||
|
|
|
@ -228,15 +228,9 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa
|
|||
,[Plain [Str "sublist"]]]]])]
|
||||
,Header 1 ("html-blocks",[],[]) [Str "HTML",Space,Str "Blocks"]
|
||||
,Para [Str "Simple",Space,Str "block",Space,Str "on",Space,Str "one",Space,Str "line:"]
|
||||
,RawBlock (Format "html") "<div>"
|
||||
,Plain [Str "foo"]
|
||||
,RawBlock (Format "html") "</div>\n"
|
||||
,Div ("",[],[]) [Plain [Str "foo"]]
|
||||
,Para [Str "And",Space,Str "nested",Space,Str "without",Space,Str "indentation:"]
|
||||
,RawBlock (Format "html") "<div>\n<div>\n<div>"
|
||||
,Plain [Str "foo"]
|
||||
,RawBlock (Format "html") "</div>\n</div>\n<div>"
|
||||
,Plain [Str "bar"]
|
||||
,RawBlock (Format "html") "</div>\n</div>\n"
|
||||
,Div ("",[],[]) [Div ("",[],[]) [Div ("",[],[]) [Plain [Str "foo"]]],Div ("",[],[]) [Plain [Str "bar"]]]
|
||||
,Para [Str "Interpreted",Space,Str "markdown",Space,Str "in",Space,Str "a",Space,Str "table:"]
|
||||
,RawBlock (Format "html") "<table>\n<tr>\n<td>"
|
||||
,Plain [Str "This",Space,Str "is",Space,Emph [Str "emphasized"]]
|
||||
|
@ -244,17 +238,13 @@ Pandoc (Meta {unMeta = fromList [("author",MetaList [MetaInlines [Str "John",Spa
|
|||
,Plain [Str "And",Space,Str "this",Space,Str "is",Space,Strong [Str "strong"]]
|
||||
,RawBlock (Format "html") "</td>\n</tr>\n</table>\n\n<script type=\"text/javascript\">document.write('This *should not* be interpreted as markdown');</script>\n"
|
||||
,Para [Str "Here\8217s",Space,Str "a",Space,Str "simple",Space,Str "block:"]
|
||||
,RawBlock (Format "html") "<div>\n "
|
||||
,Plain [Str "foo"]
|
||||
,RawBlock (Format "html") "</div>\n"
|
||||
,Div ("",[],[]) [Plain [Str "foo"]]
|
||||
,Para [Str "This",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "code",Space,Str "block,",Space,Str "though:"]
|
||||
,CodeBlock ("",[],[]) "<div>\n foo\n</div>"
|
||||
,Para [Str "As",Space,Str "should",Space,Str "this:"]
|
||||
,CodeBlock ("",[],[]) "<div>foo</div>"
|
||||
,Para [Str "Now,",Space,Str "nested:"]
|
||||
,RawBlock (Format "html") "<div>\n <div>\n <div>\n "
|
||||
,Plain [Str "foo"]
|
||||
,RawBlock (Format "html") "</div>\n </div>\n</div>\n"
|
||||
,Div ("",[],[]) [Div ("",[],[]) [Div ("",[],[]) [Plain [Str "foo"]]]]
|
||||
,Para [Str "This",Space,Str "should",Space,Str "just",Space,Str "be",Space,Str "an",Space,Str "HTML",Space,Str "comment:"]
|
||||
,RawBlock (Format "html") "<!-- Comment -->\n"
|
||||
,Para [Str "Multiline:"]
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
</outline>
|
||||
<outline text="Definition Lists" _note="Tight using spaces: apple : red fruit orange : orange fruit banana : yellow fruit Tight using tabs: apple : red fruit orange : orange fruit banana : yellow fruit Loose: apple : red fruit orange : orange fruit banana : yellow fruit Multiple blocks with italics: *apple* : red fruit contains seeds, crisp, pleasant to taste *orange* : orange fruit { orange code block } > orange block quote Multiple definitions, tight: apple : red fruit : computer orange : orange fruit : bank Multiple definitions, loose: apple : red fruit : computer orange : orange fruit : bank Blank line after term, indented marker, alternate markers: apple : red fruit : computer orange : orange fruit 1. sublist 2. sublist ">
|
||||
</outline>
|
||||
<outline text="HTML Blocks" _note="Simple block on one line: <div> foo </div> And nested without indentation: <div> <div> <div> foo </div> </div> <div> bar </div> </div> Interpreted markdown in a table: <table> <tr> <td> This is *emphasized* </td> <td> And this is **strong** </td> </tr> </table> <script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script> Here’s a simple block: <div> foo </div> This should be a code block, though: <div> foo </div> As should this: <div>foo</div> Now, nested: <div> <div> <div> foo </div> </div> </div> This should just be an HTML comment: <!-- Comment --> Multiline: <!-- Blah Blah --> <!-- This is another comment. --> Code block: <!-- Comment --> Just plain comment, with trailing spaces on the line: <!-- foo --> Code: <hr /> Hr’s: <hr> <hr /> <hr /> <hr> <hr /> <hr /> <hr class="foo" id="bar" /> <hr class="foo" id="bar" /> <hr class="foo" id="bar"> * * * * *">
|
||||
<outline text="HTML Blocks" _note="Simple block on one line: <div> foo </div> And nested without indentation: <div> <div> <div> foo </div> </div> <div> bar </div> </div> Interpreted markdown in a table: <table> <tr> <td> This is *emphasized* </td> <td> And this is **strong** </td> </tr> </table> <script type="text/javascript">document.write('This *should not* be interpreted as markdown');</script> Here’s a simple block: <div> foo </div> This should be a code block, though: <div> foo </div> As should this: <div>foo</div> Now, nested: <div> <div> <div> foo </div> </div> </div> This should just be an HTML comment: <!-- Comment --> Multiline: <!-- Blah Blah --> <!-- This is another comment. --> Code block: <!-- Comment --> Just plain comment, with trailing spaces on the line: <!-- foo --> Code: <hr /> Hr’s: <hr> <hr /> <hr /> <hr> <hr /> <hr /> <hr class="foo" id="bar" /> <hr class="foo" id="bar" /> <hr class="foo" id="bar"> * * * * *">
|
||||
</outline>
|
||||
<outline text="Inline Markup" _note="This is *emphasized*, and so *is this*. This is **strong**, and so **is this**. An *[emphasized link](/url)*. ***This is strong and em.*** So is ***this*** word. ***This is strong and em.*** So is ***this*** word. This is code: `>`, `$`, `\`, `\$`, `<html>`. ~~This is *strikeout*.~~ Superscripts: a^bc^d a^*hello*^ a^hello there^. Subscripts: H~2~O, H~23~O, H~many of them~O. These should not be superscripts or subscripts, because of the unescaped spaces: a\^b c\^d, a\~b c\~d. * * * * *">
|
||||
</outline>
|
||||
|
|
|
@ -359,7 +359,13 @@ And nested without indentation:
|
|||
|
||||
#+BEGIN_HTML
|
||||
<div>
|
||||
#+END_HTML
|
||||
|
||||
#+BEGIN_HTML
|
||||
<div>
|
||||
#+END_HTML
|
||||
|
||||
#+BEGIN_HTML
|
||||
<div>
|
||||
#+END_HTML
|
||||
|
||||
|
@ -367,7 +373,13 @@ foo
|
|||
|
||||
#+BEGIN_HTML
|
||||
</div>
|
||||
#+END_HTML
|
||||
|
||||
#+BEGIN_HTML
|
||||
</div>
|
||||
#+END_HTML
|
||||
|
||||
#+BEGIN_HTML
|
||||
<div>
|
||||
#+END_HTML
|
||||
|
||||
|
@ -375,6 +387,9 @@ bar
|
|||
|
||||
#+BEGIN_HTML
|
||||
</div>
|
||||
#+END_HTML
|
||||
|
||||
#+BEGIN_HTML
|
||||
</div>
|
||||
#+END_HTML
|
||||
|
||||
|
@ -407,7 +422,6 @@ Here's a simple block:
|
|||
|
||||
#+BEGIN_HTML
|
||||
<div>
|
||||
|
||||
#+END_HTML
|
||||
|
||||
foo
|
||||
|
@ -434,16 +448,27 @@ Now, nested:
|
|||
|
||||
#+BEGIN_HTML
|
||||
<div>
|
||||
<div>
|
||||
<div>
|
||||
|
||||
#+END_HTML
|
||||
|
||||
#+BEGIN_HTML
|
||||
<div>
|
||||
#+END_HTML
|
||||
|
||||
#+BEGIN_HTML
|
||||
<div>
|
||||
#+END_HTML
|
||||
|
||||
foo
|
||||
|
||||
#+BEGIN_HTML
|
||||
</div>
|
||||
</div>
|
||||
#+END_HTML
|
||||
|
||||
#+BEGIN_HTML
|
||||
</div>
|
||||
#+END_HTML
|
||||
|
||||
#+BEGIN_HTML
|
||||
</div>
|
||||
#+END_HTML
|
||||
|
||||
|
|
|
@ -352,10 +352,13 @@ HTML Blocks
|
|||
Simple block on one line:
|
||||
|
||||
foo
|
||||
|
||||
And nested without indentation:
|
||||
|
||||
foo
|
||||
|
||||
bar
|
||||
|
||||
Interpreted markdown in a table:
|
||||
|
||||
This is emphasized
|
||||
|
@ -363,6 +366,7 @@ And this is strong
|
|||
Here’s a simple block:
|
||||
|
||||
foo
|
||||
|
||||
This should be a code block, though:
|
||||
|
||||
<div>
|
||||
|
@ -376,6 +380,7 @@ As should this:
|
|||
Now, nested:
|
||||
|
||||
foo
|
||||
|
||||
This should just be an HTML comment:
|
||||
|
||||
Multiline:
|
||||
|
|
|
@ -394,7 +394,13 @@ And nested without indentation:
|
|||
.. raw:: html
|
||||
|
||||
<div>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<div>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<div>
|
||||
|
||||
foo
|
||||
|
@ -402,7 +408,13 @@ foo
|
|||
.. raw:: html
|
||||
|
||||
</div>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
</div>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<div>
|
||||
|
||||
bar
|
||||
|
@ -410,6 +422,9 @@ bar
|
|||
.. raw:: html
|
||||
|
||||
</div>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
</div>
|
||||
|
||||
Interpreted markdown in a table:
|
||||
|
@ -442,7 +457,6 @@ Here’s a simple block:
|
|||
.. raw:: html
|
||||
|
||||
<div>
|
||||
|
||||
|
||||
foo
|
||||
|
||||
|
@ -469,16 +483,27 @@ Now, nested:
|
|||
.. raw:: html
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<div>
|
||||
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<div>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<div>
|
||||
|
||||
foo
|
||||
|
||||
.. raw:: html
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
</div>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
</div>
|
||||
|
||||
This should just be an HTML comment:
|
||||
|
|
|
@ -352,20 +352,33 @@ h1(#html-blocks). HTML Blocks
|
|||
Simple block on one line:
|
||||
|
||||
<div>
|
||||
|
||||
foo
|
||||
|
||||
</div>
|
||||
|
||||
And nested without indentation:
|
||||
|
||||
<div>
|
||||
|
||||
<div>
|
||||
|
||||
<div>
|
||||
|
||||
foo
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
||||
bar
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
Interpreted markdown in a table:
|
||||
|
@ -386,8 +399,9 @@ And this is *strong*
|
|||
Here's a simple block:
|
||||
|
||||
<div>
|
||||
|
||||
|
||||
foo
|
||||
|
||||
</div>
|
||||
|
||||
This should be a code block, though:
|
||||
|
@ -405,12 +419,19 @@ bc. <div>foo</div>
|
|||
Now, nested:
|
||||
|
||||
<div>
|
||||
<div>
|
||||
<div>
|
||||
|
||||
|
||||
<div>
|
||||
|
||||
<div>
|
||||
|
||||
foo
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
This should just be an HTML comment:
|
||||
|
|
Loading…
Add table
Reference in a new issue