Changed strict to markdown_strict.
This commit is contained in:
parent
05216d2919
commit
8d65651309
4 changed files with 18 additions and 15 deletions
18
README
18
README
|
@ -26,8 +26,8 @@ tables, flexible ordered lists, definition lists, delimited code blocks,
|
||||||
superscript, subscript, strikeout, title blocks, automatic tables of
|
superscript, subscript, strikeout, title blocks, automatic tables of
|
||||||
contents, embedded LaTeX math, citations, and markdown inside HTML block
|
contents, embedded LaTeX math, citations, and markdown inside HTML block
|
||||||
elements. (These enhancements, described below under
|
elements. (These enhancements, described below under
|
||||||
[Pandoc's markdown](#pandocs-markdown), can be disabled using the `strict`
|
[Pandoc's markdown](#pandocs-markdown), can be disabled using the
|
||||||
input or output format.)
|
`markdown_strict` input or output format.)
|
||||||
|
|
||||||
In contrast to most existing tools for converting markdown to HTML, which
|
In contrast to most existing tools for converting markdown to HTML, which
|
||||||
use regex substitutions, Pandoc has a modular design: it consists of a
|
use regex substitutions, Pandoc has a modular design: it consists of a
|
||||||
|
@ -118,7 +118,7 @@ and `xunicode` (if `xelatex` is used).
|
||||||
A user who wants a drop-in replacement for `Markdown.pl` may create
|
A user who wants a drop-in replacement for `Markdown.pl` may create
|
||||||
a symbolic link to the `pandoc` executable called `hsmarkdown`. When
|
a symbolic link to the `pandoc` executable called `hsmarkdown`. When
|
||||||
invoked under the name `hsmarkdown`, `pandoc` will behave as if
|
invoked under the name `hsmarkdown`, `pandoc` will behave as if
|
||||||
invoked with `-f strict --email-obfuscation=references`,
|
invoked with `-f markdown_strict --email-obfuscation=references`,
|
||||||
and all command-line options will be treated as regular arguments.
|
and all command-line options will be treated as regular arguments.
|
||||||
However, this approach does not work under Cygwin, due to problems with
|
However, this approach does not work under Cygwin, due to problems with
|
||||||
its simulation of symbolic links.
|
its simulation of symbolic links.
|
||||||
|
@ -757,7 +757,7 @@ Pandoc's markdown
|
||||||
Pandoc understands an extended and slightly revised version of
|
Pandoc understands an extended and slightly revised version of
|
||||||
John Gruber's [markdown] syntax. This document explains the syntax,
|
John Gruber's [markdown] syntax. This document explains the syntax,
|
||||||
noting differences from standard markdown. Except where noted, these
|
noting differences from standard markdown. Except where noted, these
|
||||||
differences can be suppressed by using the `strict` format instead
|
differences can be suppressed by using the `markdown_strict` format instead
|
||||||
of `markdown`.
|
of `markdown`.
|
||||||
|
|
||||||
Philosophy
|
Philosophy
|
||||||
|
@ -927,7 +927,7 @@ Standard markdown syntax does not require a blank line before a block
|
||||||
quote. Pandoc does require this (except, of course, at the beginning of the
|
quote. Pandoc does require this (except, of course, at the beginning of the
|
||||||
document). The reason for the requirement is that it is all too easy for a
|
document). The reason for the requirement is that it is all too easy for a
|
||||||
`>` to end up at the beginning of a line by accident (perhaps through line
|
`>` to end up at the beginning of a line by accident (perhaps through line
|
||||||
wrapping). So, unless the `strict` format is used, the following does
|
wrapping). So, unless the `markdown_strict` format is used, the following does
|
||||||
not produce a nested block quote in pandoc:
|
not produce a nested block quote in pandoc:
|
||||||
|
|
||||||
> This is a block quote.
|
> This is a block quote.
|
||||||
|
@ -1284,7 +1284,7 @@ around "Third". Pandoc follows a simple rule: if the text is followed by
|
||||||
a blank line, it is treated as a paragraph. Since "Second" is followed
|
a blank line, it is treated as a paragraph. Since "Second" is followed
|
||||||
by a list, and not a blank line, it isn't treated as a paragraph. The
|
by a list, and not a blank line, it isn't treated as a paragraph. The
|
||||||
fact that the list is followed by a blank line is irrelevant. (Note:
|
fact that the list is followed by a blank line is irrelevant. (Note:
|
||||||
Pandoc works this way even when the `strict` format is specified. This
|
Pandoc works this way even when the `markdown_strict` format is specified. This
|
||||||
behavior is consistent with the official markdown syntax description,
|
behavior is consistent with the official markdown syntax description,
|
||||||
even though it is different from that of `Markdown.pl`.)
|
even though it is different from that of `Markdown.pl`.)
|
||||||
|
|
||||||
|
@ -1605,7 +1605,7 @@ which allows only the following characters to be backslash-escaped:
|
||||||
|
|
||||||
\`*_{}[]()>#+-.!
|
\`*_{}[]()>#+-.!
|
||||||
|
|
||||||
(However, if the `strict` format is used, the standard markdown rule
|
(However, if the `markdown_strict` format is used, the standard markdown rule
|
||||||
will be used.)
|
will be used.)
|
||||||
|
|
||||||
A backslash-escaped space is parsed as a nonbreaking space. It will
|
A backslash-escaped space is parsed as a nonbreaking space. It will
|
||||||
|
@ -1840,8 +1840,8 @@ with blank lines, and start and end at the left margin. Within
|
||||||
these blocks, everything is interpreted as HTML, not markdown;
|
these blocks, everything is interpreted as HTML, not markdown;
|
||||||
so (for example), `*` does not signify emphasis.
|
so (for example), `*` does not signify emphasis.
|
||||||
|
|
||||||
Pandoc behaves this way when the `strict` format is used; but by default,
|
Pandoc behaves this way when the `markdown_strict` format is used; but
|
||||||
pandoc interprets material between HTML block tags as markdown.
|
by default, pandoc interprets material between HTML block tags as markdown.
|
||||||
Thus, for example, Pandoc will turn
|
Thus, for example, Pandoc will turn
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
|
|
@ -176,7 +176,7 @@ parseFormatSpec = parse formatSpec ""
|
||||||
readers :: [(String, ReaderOptions -> String -> Pandoc)]
|
readers :: [(String, ReaderOptions -> String -> Pandoc)]
|
||||||
readers = [("native" , \_ -> readNative)
|
readers = [("native" , \_ -> readNative)
|
||||||
,("json" , \_ -> decodeJSON)
|
,("json" , \_ -> decodeJSON)
|
||||||
,("strict" , readMarkdown)
|
,("markdown_strict" , readMarkdown)
|
||||||
,("markdown" , readMarkdown)
|
,("markdown" , readMarkdown)
|
||||||
,("rst" , readRST)
|
,("rst" , readRST)
|
||||||
,("docbook" , readDocBook)
|
,("docbook" , readDocBook)
|
||||||
|
@ -220,7 +220,7 @@ writers = [
|
||||||
,("texinfo" , PureStringWriter writeTexinfo)
|
,("texinfo" , PureStringWriter writeTexinfo)
|
||||||
,("man" , PureStringWriter writeMan)
|
,("man" , PureStringWriter writeMan)
|
||||||
,("markdown" , PureStringWriter writeMarkdown)
|
,("markdown" , PureStringWriter writeMarkdown)
|
||||||
,("strict" , PureStringWriter writeMarkdown)
|
,("markdown_strict" , PureStringWriter writeMarkdown)
|
||||||
,("plain" , PureStringWriter writePlain)
|
,("plain" , PureStringWriter writePlain)
|
||||||
,("rst" , PureStringWriter writeRST)
|
,("rst" , PureStringWriter writeRST)
|
||||||
,("mediawiki" , PureStringWriter writeMediaWiki)
|
,("mediawiki" , PureStringWriter writeMediaWiki)
|
||||||
|
@ -231,7 +231,7 @@ writers = [
|
||||||
]
|
]
|
||||||
|
|
||||||
getDefaultExtensions :: String -> Set Extension
|
getDefaultExtensions :: String -> Set Extension
|
||||||
getDefaultExtensions "strict" = strictExtensions
|
getDefaultExtensions "markdown_strict" = strictExtensions
|
||||||
getDefaultExtensions _ = pandocExtensions
|
getDefaultExtensions _ = pandocExtensions
|
||||||
|
|
||||||
-- | Retrieve reader based on formatSpec (format+extensions).
|
-- | Retrieve reader based on formatSpec (format+extensions).
|
||||||
|
|
|
@ -92,8 +92,11 @@ getDefaultTemplate user writer = do
|
||||||
"native" -> return $ Right ""
|
"native" -> return $ Right ""
|
||||||
"json" -> return $ Right ""
|
"json" -> return $ Right ""
|
||||||
"docx" -> return $ Right ""
|
"docx" -> return $ Right ""
|
||||||
"odt" -> getDefaultTemplate user "opendocument"
|
|
||||||
"epub" -> return $ Right ""
|
"epub" -> return $ Right ""
|
||||||
|
"odt" -> getDefaultTemplate user "opendocument"
|
||||||
|
"markdown_strict" -> getDefaultTemplate user "markdown"
|
||||||
|
"multimarkdown" -> getDefaultTemplate user "markdown"
|
||||||
|
"markdown_github" -> getDefaultTemplate user "markdown"
|
||||||
_ -> let fname = "templates" </> "default" <.> format
|
_ -> let fname = "templates" </> "default" <.> format
|
||||||
in E.try $ readDataFile user fname
|
in E.try $ readDataFile user fname
|
||||||
|
|
||||||
|
|
|
@ -236,7 +236,7 @@ options =
|
||||||
(NoArg
|
(NoArg
|
||||||
(\opt -> do
|
(\opt -> do
|
||||||
err 59 $ "The --strict option has been removed.\n" ++
|
err 59 $ "The --strict option has been removed.\n" ++
|
||||||
"Use `strict' input or output format instead."
|
"Use `markdown_strict' input or output format instead."
|
||||||
return opt ))
|
return opt ))
|
||||||
"" -- "Disable markdown syntax extensions"
|
"" -- "Disable markdown syntax extensions"
|
||||||
|
|
||||||
|
@ -782,7 +782,7 @@ main = do
|
||||||
["Try " ++ prg ++ " --help for more information."]
|
["Try " ++ prg ++ " --help for more information."]
|
||||||
|
|
||||||
let defaultOpts' = if compatMode
|
let defaultOpts' = if compatMode
|
||||||
then defaultOpts { optReader = "strict"
|
then defaultOpts { optReader = "markdown_strict"
|
||||||
, optWriter = "html"
|
, optWriter = "html"
|
||||||
, optEmailObfuscation =
|
, optEmailObfuscation =
|
||||||
ReferenceObfuscation }
|
ReferenceObfuscation }
|
||||||
|
|
Loading…
Reference in a new issue