diff options
author | John MacFarlane <jgm@berkeley.edu> | 2016-01-02 22:28:07 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-01-02 22:34:06 -0800 |
commit | 97c9691696744a6e56a28dea0221e6230b029ce4 (patch) | |
tree | d57576fe724bd2e68e511c7373d6e5b2d12193f8 /src/Text/Pandoc | |
parent | 90a2df3f7c423a4e23958daf9fd2143b1a98d746 (diff) | |
download | pandoc-97c9691696744a6e56a28dea0221e6230b029ce4.tar.gz |
Textile reader: don't allow block HTML tags in inline contexts.
The reader previously did allow this, following redcloth,
which happily parses
Html blocks can be <div>inlined</div> as well.
as
<p>Html blocks can be <div>inlined</div> as well.</p>
This is invalid HTML, and this kind of thing can lead
to parsing problems (stack overflows) as well. So this
commit undoes this behavior. The above sample now produces;
<p>Html blocks can be</p>
<div>
<p>inlined</p>
</div>
<p>as well.</p>
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Readers/Textile.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/Textile.hs b/src/Text/Pandoc/Readers/Textile.hs index 355285f54..dd1d289a3 100644 --- a/src/Text/Pandoc/Readers/Textile.hs +++ b/src/Text/Pandoc/Readers/Textile.hs @@ -57,7 +57,7 @@ import Text.Pandoc.Builder (Inlines, Blocks, trimInlines) import qualified Text.Pandoc.Builder as B import Text.Pandoc.Options import Text.Pandoc.Parsing -import Text.Pandoc.Readers.HTML ( htmlTag, isBlockTag ) +import Text.Pandoc.Readers.HTML ( htmlTag, isBlockTag, isInlineTag ) import Text.Pandoc.Shared (trim) import Text.Pandoc.Readers.LaTeX ( rawLaTeXInline, rawLaTeXBlock ) import Text.HTML.TagSoup (parseTags, innerText, fromAttrib, Tag(..)) @@ -504,7 +504,7 @@ endline = try $ do return B.linebreak rawHtmlInline :: Parser [Char] ParserState Inlines -rawHtmlInline = B.rawInline "html" . snd <$> htmlTag (const True) +rawHtmlInline = B.rawInline "html" . snd <$> htmlTag isInlineTag -- | Raw LaTeX Inline rawLaTeXInline' :: Parser [Char] ParserState Inlines |