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:
John MacFarlane 2013-08-18 14:36:40 -07:00
parent 3117c668a7
commit 8d441af3da
20 changed files with 232 additions and 119 deletions

View file

@ -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

View file

@ -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 <> "*"

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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)
<> ">"

View file

@ -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

View file

@ -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:"]

View file

@ -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:

View file

@ -862,22 +862,18 @@ These should not be escaped: \$ \\ \&gt; \[ \{
<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: \$ \\ \&gt; \[ \{
<para>
Heres 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: \$ \\ \&gt; \[ \{
<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

View file

@ -324,7 +324,6 @@ These should not be escaped: \$ \\ \&gt; \[ \{</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>Heres a simple block:</p>
<div>
foo
</div>
<p>This should be a code block, though:</p>
<pre><code>&lt;div&gt;
foo
@ -365,14 +361,12 @@ foo
<pre><code>&lt;div&gt;foo&lt;/div&gt;</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 -->

View file

@ -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**
Heres 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:

View file

@ -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'''
Heres a simple block:
<div>
foo
</div>
foo
</div>
This should be a code block, though:
<pre>&lt;div&gt;
@ -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 -->

View file

@ -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:"]

View file

@ -44,7 +44,7 @@
</outline>
<outline text="Definition Lists" _note="Tight using spaces:&#10;&#10;apple&#10;: red fruit&#10;orange&#10;: orange fruit&#10;banana&#10;: yellow fruit&#10;&#10;Tight using tabs:&#10;&#10;apple&#10;: red fruit&#10;orange&#10;: orange fruit&#10;banana&#10;: yellow fruit&#10;&#10;Loose:&#10;&#10;apple&#10;: red fruit&#10;&#10;orange&#10;: orange fruit&#10;&#10;banana&#10;: yellow fruit&#10;&#10;Multiple blocks with italics:&#10;&#10;*apple*&#10;: red fruit&#10;&#10; contains seeds, crisp, pleasant to taste&#10;&#10;*orange*&#10;: orange fruit&#10;&#10; { orange code block }&#10;&#10; &gt; orange block quote&#10;&#10;Multiple definitions, tight:&#10;&#10;apple&#10;: red fruit&#10;: computer&#10;orange&#10;: orange fruit&#10;: bank&#10;&#10;Multiple definitions, loose:&#10;&#10;apple&#10;: red fruit&#10;&#10;: computer&#10;&#10;orange&#10;: orange fruit&#10;&#10;: bank&#10;&#10;Blank line after term, indented marker, alternate markers:&#10;&#10;apple&#10;: red fruit&#10;&#10;: computer&#10;&#10;orange&#10;: orange fruit&#10;&#10; 1. sublist&#10; 2. sublist&#10;&#10;">
</outline>
<outline text="HTML Blocks" _note="Simple block on one line:&#10;&#10;&lt;div&gt;&#10;foo&#10;&lt;/div&gt;&#10;&#10;And nested without indentation:&#10;&#10;&lt;div&gt;&#10;&lt;div&gt;&#10;&lt;div&gt;&#10;foo&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&lt;div&gt;&#10;bar&#10;&lt;/div&gt;&#10;&lt;/div&gt;&#10;&#10;Interpreted markdown in a table:&#10;&#10;&lt;table&gt;&#10;&lt;tr&gt;&#10;&lt;td&gt;&#10;This is *emphasized*&#10;&lt;/td&gt;&#10;&lt;td&gt;&#10;And this is **strong**&#10;&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;/table&gt;&#10;&#10;&lt;script type=&quot;text/javascript&quot;&gt;document.write('This *should not* be interpreted as markdown');&lt;/script&gt;&#10;&#10;Heres a simple block:&#10;&#10;&lt;div&gt;&#10; &#10;foo&#10;&lt;/div&gt;&#10;&#10;This should be a code block, though:&#10;&#10; &lt;div&gt;&#10; foo&#10; &lt;/div&gt;&#10;&#10;As should this:&#10;&#10; &lt;div&gt;foo&lt;/div&gt;&#10;&#10;Now, nested:&#10;&#10;&lt;div&gt;&#10; &lt;div&gt;&#10; &lt;div&gt;&#10; &#10;foo&#10;&lt;/div&gt;&#10; &lt;/div&gt;&#10;&lt;/div&gt;&#10;&#10;This should just be an HTML comment:&#10;&#10;&lt;!-- Comment --&gt;&#10;&#10;Multiline:&#10;&#10;&lt;!--&#10;Blah&#10;Blah&#10;--&gt;&#10;&#10;&lt;!--&#10; This is another comment.&#10;--&gt;&#10;&#10;Code block:&#10;&#10; &lt;!-- Comment --&gt;&#10;&#10;Just plain comment, with trailing spaces on the line:&#10;&#10;&lt;!-- foo --&gt; &#10;&#10;Code:&#10;&#10; &lt;hr /&gt;&#10;&#10;Hrs:&#10;&#10;&lt;hr&gt;&#10;&#10;&lt;hr /&gt;&#10;&#10;&lt;hr /&gt;&#10;&#10;&lt;hr&gt; &#10;&#10;&lt;hr /&gt; &#10;&#10;&lt;hr /&gt; &#10;&#10;&lt;hr class=&quot;foo&quot; id=&quot;bar&quot; /&gt;&#10;&#10;&lt;hr class=&quot;foo&quot; id=&quot;bar&quot; /&gt;&#10;&#10;&lt;hr class=&quot;foo&quot; id=&quot;bar&quot;&gt;&#10;&#10;* * * * *">
<outline text="HTML Blocks" _note="Simple block on one line:&#10;&#10;&lt;div&gt;&#10;&#10;foo&#10;&#10;&lt;/div&gt;&#10;&#10;And nested without indentation:&#10;&#10;&lt;div&gt;&#10;&#10;&lt;div&gt;&#10;&#10;&lt;div&gt;&#10;&#10;foo&#10;&#10;&lt;/div&gt;&#10;&#10;&lt;/div&gt;&#10;&#10;&lt;div&gt;&#10;&#10;bar&#10;&#10;&lt;/div&gt;&#10;&#10;&lt;/div&gt;&#10;&#10;Interpreted markdown in a table:&#10;&#10;&lt;table&gt;&#10;&lt;tr&gt;&#10;&lt;td&gt;&#10;This is *emphasized*&#10;&lt;/td&gt;&#10;&lt;td&gt;&#10;And this is **strong**&#10;&lt;/td&gt;&#10;&lt;/tr&gt;&#10;&lt;/table&gt;&#10;&#10;&lt;script type=&quot;text/javascript&quot;&gt;document.write('This *should not* be interpreted as markdown');&lt;/script&gt;&#10;&#10;Heres a simple block:&#10;&#10;&lt;div&gt;&#10;&#10;foo&#10;&#10;&lt;/div&gt;&#10;&#10;This should be a code block, though:&#10;&#10; &lt;div&gt;&#10; foo&#10; &lt;/div&gt;&#10;&#10;As should this:&#10;&#10; &lt;div&gt;foo&lt;/div&gt;&#10;&#10;Now, nested:&#10;&#10;&lt;div&gt;&#10;&#10;&lt;div&gt;&#10;&#10;&lt;div&gt;&#10;&#10;foo&#10;&#10;&lt;/div&gt;&#10;&#10;&lt;/div&gt;&#10;&#10;&lt;/div&gt;&#10;&#10;This should just be an HTML comment:&#10;&#10;&lt;!-- Comment --&gt;&#10;&#10;Multiline:&#10;&#10;&lt;!--&#10;Blah&#10;Blah&#10;--&gt;&#10;&#10;&lt;!--&#10; This is another comment.&#10;--&gt;&#10;&#10;Code block:&#10;&#10; &lt;!-- Comment --&gt;&#10;&#10;Just plain comment, with trailing spaces on the line:&#10;&#10;&lt;!-- foo --&gt; &#10;&#10;Code:&#10;&#10; &lt;hr /&gt;&#10;&#10;Hrs:&#10;&#10;&lt;hr&gt;&#10;&#10;&lt;hr /&gt;&#10;&#10;&lt;hr /&gt;&#10;&#10;&lt;hr&gt; &#10;&#10;&lt;hr /&gt; &#10;&#10;&lt;hr /&gt; &#10;&#10;&lt;hr class=&quot;foo&quot; id=&quot;bar&quot; /&gt;&#10;&#10;&lt;hr class=&quot;foo&quot; id=&quot;bar&quot; /&gt;&#10;&#10;&lt;hr class=&quot;foo&quot; id=&quot;bar&quot;&gt;&#10;&#10;* * * * *">
</outline>
<outline text="Inline Markup" _note="This is *emphasized*, and so *is this*.&#10;&#10;This is **strong**, and so **is this**.&#10;&#10;An *[emphasized link](/url)*.&#10;&#10;***This is strong and em.***&#10;&#10;So is ***this*** word.&#10;&#10;***This is strong and em.***&#10;&#10;So is ***this*** word.&#10;&#10;This is code: `&gt;`, `$`, `\`, `\$`, `&lt;html&gt;`.&#10;&#10;~~This is *strikeout*.~~&#10;&#10;Superscripts: a^bc^d a^*hello*^ a^hello there^.&#10;&#10;Subscripts: H~2~O, H~23~O, H~many of them~O.&#10;&#10;These should not be superscripts or subscripts, because of the unescaped&#10;spaces: a\^b c\^d, a\~b c\~d.&#10;&#10;* * * * *">
</outline>

View file

@ -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

View file

@ -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
Heres 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:

View file

@ -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 @@ Heres 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:

View file

@ -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: