Export to GitHub

pandoc - issue #226

writerStandalone for html output broken?


Posted on Mar 31, 2010 by Happy Hippo

What steps will reproduce the problem?

run the file:

import Text.Pandoc

t :: String t = "test stuff"

main :: IO () main = do let a = doit defaultWriterOptions t let b = doit (defaultWriterOptions {writerStandalone = True}) t putStrLn $ "a:\n" ++ a ++ "\nb:\n" ++ b where doit wopt = (writeHtmlString wopt) . (readMarkdown defaultParserState)

What is the expected output?

with pandoc-1.3, I get:

a: <p >test stuff</p > b: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1- transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml&quot; ><head ><title ></title ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><meta name="generator" content="pandoc" /></head ><body ><p >test stuff</p ></body ></html >

What do you see instead? with pandoc-1.5.1.1 I get:

a: <p >test stuff</p > b:

  • so writeHtmlString with writerStandalone = True produces an empty string instead of the expected html

Comment #1

Posted on Mar 31, 2010 by Grumpy Dog

This is a duplicate of issue 218, so see there for the fix: http://code.google.com/p/pandoc/issues/detail?id=218

Comment #2

Posted on Apr 1, 2010 by Happy Hippo

Thank you for the quick reply, and sorry for the duplicate.

Status: Duplicate

Labels:
Type-Defect Priority-Medium