git.iko.soy/typeable/pandoc
on master help sign in
Removed readerOldDashes and --old-dashes option, added old_dashes extension.
5bf9125John MacFarlane
MANUAL.txt+7−6
@@ -394,12 +394,6 @@ Reader options
394 HTML codes and LaTeX environments. (The LaTeX reader does pass through
394 HTML codes and LaTeX environments. (The LaTeX reader does pass through
395 untranslatable LaTeX *commands*, even if `-R` is not specified.)
395 untranslatable LaTeX *commands*, even if `-R` is not specified.)
396
396
397−`--old-dashes`
398−
399−: Selects the pandoc <= 1.8.2.1 behavior for parsing smart dashes: `-` before
400− a numeral is an en-dash, and `--` is an em-dash. This option is selected
401− automatically for `textile` input.
402−
403`--base-header-level=`*NUMBER*
397`--base-header-level=`*NUMBER*
404
398
405: Specify the base level for headers (defaults to 1).
399: Specify the base level for headers (defaults to 1).
@@ -3401,6 +3395,13 @@ Note: if your LaTeX template or any included header file call
3401for the [`csquotes`] package, pandoc will detect this
3395for the [`csquotes`] package, pandoc will detect this
3402automatically and use `\enquote{...}` for quoted text.
3396automatically and use `\enquote{...}` for quoted text.
3403
3397
3398+#### Extension: `old_dashes` ####
3399+
3400+Selects the pandoc <= 1.8.2.1 behavior for parsing smart dashes:
3401+`-` before a numeral is an en-dash, and `--` is an em-dash.
3402+This option only has an effect if `smart` is enabled. It is
3403+selected automatically for `textile` input.
3404+
3404#### Extension: `angle_brackets_escapable` ####
3405#### Extension: `angle_brackets_escapable` ####
3405
3406
3406Allow `<` and `>` to be backslash-escaped, as they can be in
3407Allow `<` and `>` to be backslash-escaped, as they can be in
pandoc.hs−9
@@ -112,7 +112,6 @@ convertWithOpts opts args = do
112 , optSectionDivs = sectionDivs
112 , optSectionDivs = sectionDivs
113 , optIncremental = incremental
113 , optIncremental = incremental
114 , optSelfContained = selfContained
114 , optSelfContained = selfContained
115− , optOldDashes = oldDashes
116 , optHtml5 = html5
115 , optHtml5 = html5
117 , optHtmlQTags = htmlQTags
116 , optHtmlQTags = htmlQTags
118 , optHighlight = highlight
117 , optHighlight = highlight
@@ -302,7 +301,6 @@ convertWithOpts opts args = do
302 , readerParseRaw = parseRaw
301 , readerParseRaw = parseRaw
303 , readerColumns = columns
302 , readerColumns = columns
304 , readerTabStop = tabStop
303 , readerTabStop = tabStop
305− , readerOldDashes = oldDashes
306 , readerIndentedCodeClasses = codeBlockClasses
304 , readerIndentedCodeClasses = codeBlockClasses
307 , readerApplyMacros = not laTeXOutput
305 , readerApplyMacros = not laTeXOutput
308 , readerDefaultImageExtension = defaultImageExtension
306 , readerDefaultImageExtension = defaultImageExtension
@@ -546,7 +544,6 @@ data Opt = Opt
546 , optSectionDivs :: Bool -- ^ Put sections in div tags in HTML
544 , optSectionDivs :: Bool -- ^ Put sections in div tags in HTML
547 , optIncremental :: Bool -- ^ Use incremental lists in Slidy/Slideous/S5
545 , optIncremental :: Bool -- ^ Use incremental lists in Slidy/Slideous/S5
548 , optSelfContained :: Bool -- ^ Make HTML accessible offline
546 , optSelfContained :: Bool -- ^ Make HTML accessible offline
549− , optOldDashes :: Bool -- ^ Parse dashes like pandoc <=1.8.2.1
550 , optHtml5 :: Bool -- ^ Produce HTML5 in HTML
547 , optHtml5 :: Bool -- ^ Produce HTML5 in HTML
551 , optHtmlQTags :: Bool -- ^ Use <q> tags in HTML
548 , optHtmlQTags :: Bool -- ^ Use <q> tags in HTML
552 , optHighlight :: Bool -- ^ Highlight source code
549 , optHighlight :: Bool -- ^ Highlight source code
@@ -611,7 +608,6 @@ defaultOpts = Opt
611 , optSectionDivs = False
608 , optSectionDivs = False
612 , optIncremental = False
609 , optIncremental = False
613 , optSelfContained = False
610 , optSelfContained = False
614− , optOldDashes = False
615 , optHtml5 = False
611 , optHtml5 = False
616 , optHtmlQTags = False
612 , optHtmlQTags = False
617 , optHighlight = True
613 , optHighlight = True
@@ -689,11 +685,6 @@ options =
689 (\opt -> return opt { optParseRaw = True }))
685 (\opt -> return opt { optParseRaw = True }))
690 "" -- "Parse untranslatable HTML codes and LaTeX environments as raw"
686 "" -- "Parse untranslatable HTML codes and LaTeX environments as raw"
691
687
692− , Option "" ["old-dashes"]
693− (NoArg
694− (\opt -> return opt { optOldDashes = True }))
695− "" -- "Use smart quotes, dashes, and ellipses"
696−
697 , Option "" ["base-header-level"]
688 , Option "" ["base-header-level"]
698 (ReqArg
689 (ReqArg
699 (\arg opt ->
690 (\arg opt ->
src/Text/Pandoc.hs+4−2
@@ -338,8 +338,6 @@ getDefaultExtensions "plain" = plainExtensions
338getDefaultExtensions "org" = extensionsFromList
338getDefaultExtensions "org" = extensionsFromList
339 [Ext_citations,
339 [Ext_citations,
340 Ext_auto_identifiers]
340 Ext_auto_identifiers]
341−getDefaultExtensions "textile" = extensionsFromList
342− [Ext_auto_identifiers]
343getDefaultExtensions "html" = extensionsFromList
341getDefaultExtensions "html" = extensionsFromList
344 [Ext_auto_identifiers,
342 [Ext_auto_identifiers,
345 Ext_native_divs,
343 Ext_native_divs,
@@ -356,6 +354,10 @@ getDefaultExtensions "latex" = extensionsFromList
356getDefaultExtensions "context" = extensionsFromList
354getDefaultExtensions "context" = extensionsFromList
357 [Ext_smart,
355 [Ext_smart,
358 Ext_auto_identifiers]
356 Ext_auto_identifiers]
357+getDefaultExtensions "textile" = extensionsFromList
358+ [Ext_old_dashes,
359+ Ext_smart,
360+ Ext_auto_identifiers]
359getDefaultExtensions _ = extensionsFromList
361getDefaultExtensions _ = extensionsFromList
360 [Ext_auto_identifiers]
362 [Ext_auto_identifiers]
361
363
src/Text/Pandoc/Extensions.hs+1
@@ -131,6 +131,7 @@ data Extension =
131 | Ext_epub_html_exts -- ^ Recognise the EPUB extended version of HTML
131 | Ext_epub_html_exts -- ^ Recognise the EPUB extended version of HTML
132 | Ext_shortcut_reference_links -- ^ Shortcut reference links
132 | Ext_shortcut_reference_links -- ^ Shortcut reference links
133 | Ext_smart -- ^ "Smart" quotes, apostrophes, ellipses, dashes
133 | Ext_smart -- ^ "Smart" quotes, apostrophes, ellipses, dashes
134+ | Ext_old_dashes -- ^ -- = em, - before number = en
134 deriving (Show, Read, Enum, Eq, Ord, Bounded, Data, Typeable, Generic)
135 deriving (Show, Read, Enum, Eq, Ord, Bounded, Data, Typeable, Generic)
135
136
136pandocExtensions :: Extensions
137pandocExtensions :: Extensions
src/Text/Pandoc/Options.hs−4
@@ -58,9 +58,6 @@ data ReaderOptions = ReaderOptions{
58 , readerParseRaw :: Bool -- ^ Parse raw HTML, LaTeX
58 , readerParseRaw :: Bool -- ^ Parse raw HTML, LaTeX
59 , readerColumns :: Int -- ^ Number of columns in terminal
59 , readerColumns :: Int -- ^ Number of columns in terminal
60 , readerTabStop :: Int -- ^ Tab stop
60 , readerTabStop :: Int -- ^ Tab stop
61− , readerOldDashes :: Bool -- ^ Use pandoc <= 1.8.2.1 behavior
62− -- in parsing dashes; -- is em-dash;
63− -- - before numerial is en-dash
64 , readerApplyMacros :: Bool -- ^ Apply macros to TeX math
61 , readerApplyMacros :: Bool -- ^ Apply macros to TeX math
65 , readerIndentedCodeClasses :: [String] -- ^ Default classes for
62 , readerIndentedCodeClasses :: [String] -- ^ Default classes for
66 -- indented code blocks
63 -- indented code blocks
@@ -77,7 +74,6 @@ instance Default ReaderOptions
77 , readerParseRaw = False
74 , readerParseRaw = False
78 , readerColumns = 80
75 , readerColumns = 80
79 , readerTabStop = 4
76 , readerTabStop = 4
80− , readerOldDashes = False
81 , readerApplyMacros = True
77 , readerApplyMacros = True
82 , readerIndentedCodeClasses = []
78 , readerIndentedCodeClasses = []
83 , readerDefaultImageExtension = ""
79 , readerDefaultImageExtension = ""
src/Text/Pandoc/Parsing.hs+1−1
@@ -1183,7 +1183,7 @@ ellipses = try (string "..." >> return (B.str "\8230"))
1183dash :: (HasReaderOptions st, Stream s m Char)
1183dash :: (HasReaderOptions st, Stream s m Char)
1184 => ParserT s st m Inlines
1184 => ParserT s st m Inlines
1185dash = try $ do
1185dash = try $ do
1186− oldDashes <- getOption readerOldDashes
1186+ oldDashes <- extensionEnabled Ext_old_dashes <$> getOption readerExtensions
1187 if oldDashes
1187 if oldDashes
1188 then do
1188 then do
1189 char '-'
1189 char '-'
src/Text/Pandoc/Readers/Textile.hs+1−3
@@ -91,9 +91,7 @@ parseTextile = do
91 -- asked for, for better conversion to other light markup formats
91 -- asked for, for better conversion to other light markup formats
92 oldOpts <- stateOptions `fmap` getState
92 oldOpts <- stateOptions `fmap` getState
93 updateState $ \state -> state{ stateOptions =
93 updateState $ \state -> state{ stateOptions =
94− oldOpts{ readerParseRaw = True
94+ oldOpts{ readerParseRaw = True } }
95− , readerOldDashes = True
96− } }
97 many blankline
95 many blankline
98 startPos <- getPosition
96 startPos <- getPosition
99 -- go through once just to get list of reference keys and notes
97 -- go through once just to get list of reference keys and notes
tests/textile-reader.native+8−8
@@ -1,5 +1,5 @@
1Pandoc (Meta {unMeta = fromList []})
1Pandoc (Meta {unMeta = fromList []})
2−[Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "set",Space,Str "of",Space,Str "tests",Space,Str "for",Space,Str "pandoc",Space,Str "Textile",Space,Str "Reader.",Space,Str "Part",Space,Str "of",Space,Str "it",Space,Str "comes",LineBreak,Str "from",Space,Str "John",Space,Str "Gruber's",Space,Str "markdown",Space,Str "test",Space,Str "suite."]
2+[Para [Str "This",Space,Str "is",Space,Str "a",Space,Str "set",Space,Str "of",Space,Str "tests",Space,Str "for",Space,Str "pandoc",Space,Str "Textile",Space,Str "Reader.",Space,Str "Part",Space,Str "of",Space,Str "it",Space,Str "comes",LineBreak,Str "from",Space,Str "John",Space,Str "Gruber\8217s",Space,Str "markdown",Space,Str "test",Space,Str "suite."]
3,HorizontalRule
3,HorizontalRule
4,Header 1 ("headers",[],[]) [Str "Headers"]
4,Header 1 ("headers",[],[]) [Str "Headers"]
5,Header 2 ("level-2-with-an-embeded-link",[],[]) [Str "Level",Space,Str "2",Space,Str "with",Space,Str "an",Space,Link ("",[],[]) [Str "embeded",Space,Str "link"] ("http://www.example.com","")]
5,Header 2 ("level-2-with-an-embeded-link",[],[]) [Str "Level",Space,Str "2",Space,Str "with",Space,Str "an",Space,Link ("",[],[]) [Str "embeded",Space,Str "link"] ("http://www.example.com","")]
@@ -8,9 +8,9 @@ Pandoc (Meta {unMeta = fromList []})
8,Header 5 ("level-5",[],[]) [Str "Level",Space,Str "5"]
8,Header 5 ("level-5",[],[]) [Str "Level",Space,Str "5"]
9,Header 6 ("level-6",[],[]) [Str "Level",Space,Str "6"]
9,Header 6 ("level-6",[],[]) [Str "Level",Space,Str "6"]
10,Header 1 ("paragraphs",[],[]) [Str "Paragraphs"]
10,Header 1 ("paragraphs",[],[]) [Str "Paragraphs"]
11−,Para [Str "Here's",Space,Str "a",Space,Str "regular",Space,Str "paragraph."]
11+,Para [Str "Here\8217s",Space,Str "a",Space,Str "regular",Space,Str "paragraph."]
12,Para [Str "Line",Space,Str "breaks",Space,Str "are",Space,Str "preserved",Space,Str "in",Space,Str "textile,",Space,Str "so",Space,Str "you",Space,Str "can",Space,Str "not",Space,Str "wrap",Space,Str "your",Space,Str "very",LineBreak,Str "long",Space,Str "paragraph",Space,Str "with",Space,Str "your",Space,Str "favourite",Space,Str "text",Space,Str "editor",Space,Str "and",Space,Str "have",Space,Str "it",Space,Str "rendered",LineBreak,Str "with",Space,Str "no",Space,Str "break."]
12,Para [Str "Line",Space,Str "breaks",Space,Str "are",Space,Str "preserved",Space,Str "in",Space,Str "textile,",Space,Str "so",Space,Str "you",Space,Str "can",Space,Str "not",Space,Str "wrap",Space,Str "your",Space,Str "very",LineBreak,Str "long",Space,Str "paragraph",Space,Str "with",Space,Str "your",Space,Str "favourite",Space,Str "text",Space,Str "editor",Space,Str "and",Space,Str "have",Space,Str "it",Space,Str "rendered",LineBreak,Str "with",Space,Str "no",Space,Str "break."]
13−,Para [Str "Here's",Space,Str "one",Space,Str "with",Space,Str "a",Space,Str "bullet."]
13+,Para [Str "Here\8217s",Space,Str "one",Space,Str "with",Space,Str "a",Space,Str "bullet."]
14,BulletList
14,BulletList
15 [[Plain [Str "criminey."]]]
15 [[Plain [Str "criminey."]]]
16,Para [Str "There",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "paragraph",Space,Str "break",Space,Str "between",Space,Str "here"]
16,Para [Str "There",Space,Str "should",Space,Str "be",Space,Str "a",Space,Str "paragraph",Space,Str "break",Space,Str "between",Space,Str "here"]
@@ -89,14 +89,14 @@ Pandoc (Meta {unMeta = fromList []})
89,Para [Str "This",Space,Str "is",Space,Emph [Str "emphasized"],Str ",",Space,Str "and",Space,Str "so",Space,Emph [Str "is",Space,Str "this"],Str ".",LineBreak,Str "This",Space,Str "is",Space,Strong [Str "strong"],Str ",",Space,Str "and",Space,Str "so",Space,Strong [Str "is",Space,Str "this"],Str ".",LineBreak,Str "Hyphenated-words-are-ok,",Space,Str "as",Space,Str "well",Space,Str "as",Space,Str "strange_underscore_notation.",LineBreak,Str "A",Space,Link ("",[],[]) [Strong [Str "strong",Space,Str "link"]] ("http://www.foobar.com",""),Str "."]
89,Para [Str "This",Space,Str "is",Space,Emph [Str "emphasized"],Str ",",Space,Str "and",Space,Str "so",Space,Emph [Str "is",Space,Str "this"],Str ".",LineBreak,Str "This",Space,Str "is",Space,Strong [Str "strong"],Str ",",Space,Str "and",Space,Str "so",Space,Strong [Str "is",Space,Str "this"],Str ".",LineBreak,Str "Hyphenated-words-are-ok,",Space,Str "as",Space,Str "well",Space,Str "as",Space,Str "strange_underscore_notation.",LineBreak,Str "A",Space,Link ("",[],[]) [Strong [Str "strong",Space,Str "link"]] ("http://www.foobar.com",""),Str "."]
90,Para [Emph [Strong [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em."]],LineBreak,Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word",Space,Str "and",Space,Emph [Strong [Str "that",Space,Str "one"]],Str ".",LineBreak,Strikeout [Str "This",Space,Str "is",Space,Str "strikeout",Space,Str "and",Space,Strong [Str "strong"]]]
90,Para [Emph [Strong [Str "This",Space,Str "is",Space,Str "strong",Space,Str "and",Space,Str "em."]],LineBreak,Str "So",Space,Str "is",Space,Strong [Emph [Str "this"]],Space,Str "word",Space,Str "and",Space,Emph [Strong [Str "that",Space,Str "one"]],Str ".",LineBreak,Strikeout [Str "This",Space,Str "is",Space,Str "strikeout",Space,Str "and",Space,Strong [Str "strong"]]]
91,Para [Str "Superscripts:",Space,Str "a",Superscript [Str "bc"],Str "d",Space,Str "a",Space,Superscript [Strong [Str "hello"]],Space,Str "a",Superscript [Str "hello",Space,Str "there"],Str ".",LineBreak,Str "Subscripts:",Space,Subscript [Str "here"],Space,Str "H",Space,Subscript [Str "2"],Str "O,",Space,Str "H",Space,Subscript [Str "23"],Str "O,",Space,Str "H",Space,Subscript [Str "many",Space,Str "of",Space,Str "them"],Str "O."]
91,Para [Str "Superscripts:",Space,Str "a",Superscript [Str "bc"],Str "d",Space,Str "a",Space,Superscript [Strong [Str "hello"]],Space,Str "a",Superscript [Str "hello",Space,Str "there"],Str ".",LineBreak,Str "Subscripts:",Space,Subscript [Str "here"],Space,Str "H",Space,Subscript [Str "2"],Str "O,",Space,Str "H",Space,Subscript [Str "23"],Str "O,",Space,Str "H",Space,Subscript [Str "many",Space,Str "of",Space,Str "them"],Str "O."]
92−,Para [Str "Dashes",Space,Str ":",Space,Str "How",Space,Str "cool",Space,Str "--",Space,Str "automatic",Space,Str "dashes."]
92+,Para [Str "Dashes",Space,Str ":",Space,Str "How",Space,Str "cool",Space,Str "\8212",Space,Str "automatic",Space,Str "dashes."]
93−,Para [Str "Elipses",Space,Str ":",Space,Str "He",Space,Str "thought",Space,Str "and",Space,Str "thought",Space,Str "...",Space,Str "and",Space,Str "then",Space,Str "thought",Space,Str "some",Space,Str "more."]
93+,Para [Str "Elipses",Space,Str ":",Space,Str "He",Space,Str "thought",Space,Str "and",Space,Str "thought",Space,Str "\8230",Space,Str "and",Space,Str "then",Space,Str "thought",Space,Str "some",Space,Str "more."]
94−,Para [Str "Quotes",Space,Str "and",Space,Str "apostrophes",Space,Str ":",Space,Str "\"I'd",Space,Str "like",Space,Str "to",Space,Str "thank",Space,Str "you\"",Space,Str "for",Space,Str "example."]
94+,Para [Str "Quotes",Space,Str "and",Space,Str "apostrophes",Space,Str ":",Space,Quoted DoubleQuote [Str "I\8217d",Space,Str "like",Space,Str "to",Space,Str "thank",Space,Str "you"],Space,Str "for",Space,Str "example."]
95,Header 1 ("links",[],[]) [Str "Links"]
95,Header 1 ("links",[],[]) [Str "Links"]
96,Header 2 ("explicit",[],[]) [Str "Explicit"]
96,Header 2 ("explicit",[],[]) [Str "Explicit"]
97,Para [Str "Just",Space,Str "a",Space,Link ("",[],[]) [Str "url"] ("http://www.url.com","")]
97,Para [Str "Just",Space,Str "a",Space,Link ("",[],[]) [Str "url"] ("http://www.url.com","")]
98,Para [Link ("",[],[]) [Str "Email",Space,Str "link"] ("mailto:nobody@nowhere.net","")]
98,Para [Link ("",[],[]) [Str "Email",Space,Str "link"] ("mailto:nobody@nowhere.net","")]
99−,Para [Str "\"not",Space,Str "a",Space,Str "link\":",Space,Str "foo"]
99+,Para [Quoted DoubleQuote [Str "not",Space,Str "a",Space,Str "link"],Str ":",Space,Str "foo"]
100,Para [Str "Automatic",Space,Str "linking",Space,Str "to",Space,Link ("",[],[]) [Str "http://www.example.com"] ("http://www.example.com",""),Str "."]
100,Para [Str "Automatic",Space,Str "linking",Space,Str "to",Space,Link ("",[],[]) [Str "http://www.example.com"] ("http://www.example.com",""),Str "."]
101,Para [Link ("",[],[]) [Str "Example"] ("http://www.example.com/",""),Str ":",Space,Str "Example",Space,Str "of",Space,Str "a",Space,Str "link",Space,Str "followed",Space,Str "by",Space,Str "a",Space,Str "colon."]
101,Para [Link ("",[],[]) [Str "Example"] ("http://www.example.com/",""),Str ":",Space,Str "Example",Space,Str "of",Space,Str "a",Space,Str "link",Space,Str "followed",Space,Str "by",Space,Str "a",Space,Str "colon."]
102,Para [Str "A",Space,Str "link",Link ("",[],[]) [Str "with",Space,Str "brackets"] ("http://www.example.com",""),Str "and",Space,Str "no",Space,Str "spaces."]
102,Para [Str "A",Space,Str "link",Link ("",[],[]) [Str "with",Space,Str "brackets"] ("http://www.example.com",""),Str "and",Space,Str "no",Space,Str "spaces."]
@@ -117,7 +117,7 @@ Pandoc (Meta {unMeta = fromList []})
117 ,[[Plain [Str "bella"]]
117 ,[[Plain [Str "bella"]]
118 ,[Plain [Str "45"]]
118 ,[Plain [Str "45"]]
119 ,[Plain [Str "f"]]]]
119 ,[Plain [Str "f"]]]]
120−,Para [Str "and",Space,Str "some",Space,Str "text",Space,Str "following",Space,Str "..."]
120+,Para [Str "and",Space,Str "some",Space,Str "text",Space,Str "following",Space,Str "\8230"]
121,Header 2 ("with-headers",[],[]) [Str "With",Space,Str "headers"]
121,Header 2 ("with-headers",[],[]) [Str "With",Space,Str "headers"]
122,Table [] [AlignDefault,AlignDefault,AlignDefault] [0.0,0.0,0.0]
122,Table [] [AlignDefault,AlignDefault,AlignDefault] [0.0,0.0,0.0]
123 [[Plain [Str "name"]]
123 [[Plain [Str "name"]]