Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add output format markdown+strict #398

Closed
wants to merge 1 commit into from

2 participants

@sol
sol commented

No description provided.

@sol

@jgm anything wrong with this?

@jgm
Owner

I think the idea is sound: currently '--strict' applies indiscriminately to both reader and writer, and that prevents you from using pandoc to convert nonstrict to strict markdown and vice versa.

I think that if we are going to add a markdown+strict output format, we should also add a markdown+strict input format. It would probably also make sense to deprecate the '--strict' option.

Also: if it becomes possible to convert from nonstrict markdown to strict markdown, some changes to the writer will be needed. For example, what should a strict markdown writer do with a table or definition list? Presumably tables should be converted to HTML (using the HTML writer?) and replaced with raw HTML blocks prior to processing. In the case of definition lists, I think it might be better to replace them with special itemized lists, but I'm not sure. Delimited code blocks should not be used for code, even if attributes are specified.

@sol

@jgm Oh I assumed that the writer already handles that, and that just the user interface is missing. Probably I did not try the cases that are problematic.

It's fine with me to close this pull request, if there is more work to be done first. We still have #397.

@jgm
Owner

Commit 0cb7362 adds strict as a regular input or output format, so you can now do pandoc -f markdown -t strict or pandoc -f strict -t markdown, and even pandoc -f strict+footnotes -t markdown.

@jgm jgm closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Feb 2, 2012
  1. @sol
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 0 deletions.
  1. +2 −0  README
  2. +2 −0  src/Text/Pandoc.hs
View
2  README
@@ -159,6 +159,8 @@ General options
to `markdown`, `rst`, `latex`, `html`, or `html5`, the output will
be rendered as literate Haskell source: see [Literate Haskell
support](#literate-haskell-support), below.
+ If `+strict` is appended to `markdown`, the generated output will contain
+ no pandoc extensions.
`-o` *FILE*, `--output=`*FILE*
: Write output to *FILE* instead of *stdout*. If *FILE* is
View
2  src/Text/Pandoc.hs
@@ -198,6 +198,8 @@ writers = [("native" , writeNative)
,("markdown" , writeMarkdown)
,("markdown+lhs" , \o ->
writeMarkdown o{ writerLiterateHaskell = True })
+ ,("markdown+strict" , \o ->
+ writeMarkdown o{ writerStrictMarkdown = True })
,("plain" , writePlain)
,("rst" , writeRST)
,("rst+lhs" , \o ->
Something went wrong with that request. Please try again.