summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-08-08 15:20:29 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-08-08 15:20:29 -0700
commita4a6b6f28cefb26563b53d8fbf9195023bad2742 (patch)
tree9f398a758ed9affd4e52adb9d987cffa1c680064
parentaae90a8671d4fdb46ede2669e6713a559b9d3fbb (diff)
Plain writer: Use ALL CAPS for level 1 headers.
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs5
-rw-r--r--tests/writer.plain30
2 files changed, 19 insertions, 16 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index 5c0476b7d..95d4db29b 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -357,7 +357,10 @@ blockToMarkdown opts (Header level attr inlines) = do
_ | isEnabled Ext_header_attributes opts ->
space <> attrsToMarkdown attr
| otherwise -> empty
- contents <- inlineListToMarkdown opts inlines
+ contents <- inlineListToMarkdown opts $
+ if level == 1 && plain
+ then capitalize inlines
+ else inlines
let setext = writerSetextHeaders opts
return $ nowrap
$ case level of
diff --git a/tests/writer.plain b/tests/writer.plain
index 68f563b4a..fab0489ac 100644
--- a/tests/writer.plain
+++ b/tests/writer.plain
@@ -9,7 +9,7 @@ markdown test suite.
-Headers
+HEADERS
Level 2 with an embedded link
@@ -22,7 +22,7 @@ Level 5
-Level 1
+LEVEL 1
Level 2 with _emphasis_
@@ -40,7 +40,7 @@ with no blank line
-Paragraphs
+PARAGRAPHS
Here’s a regular paragraph.
@@ -58,7 +58,7 @@ here.
-Block Quotes
+BLOCK QUOTES
E-mail style:
@@ -90,7 +90,7 @@ And a following paragraph.
-Code Blocks
+CODE BLOCKS
Code:
@@ -113,7 +113,7 @@ And:
-Lists
+LISTS
Unordered
@@ -277,7 +277,7 @@ B. Williams
-Definition Lists
+DEFINITION LISTS
Tight using spaces:
@@ -373,7 +373,7 @@ orange
-HTML Blocks
+HTML BLOCKS
Simple block on one line:
@@ -428,7 +428,7 @@ Hr’s:
-Inline Markup
+INLINE MARKUP
This is _emphasized_, and so _is this_.
@@ -460,7 +460,7 @@ spaces: a^b c^d, a~b c~d.
-Smart quotes, ellipses, dashes
+SMART QUOTES, ELLIPSES, DASHES
“Hello,” said the spider. “‘Shelob’ is my name.”
@@ -483,7 +483,7 @@ Ellipses…and…and….
-LaTeX
+LATEX
-
@@ -510,7 +510,7 @@ Here’s a LaTeX table:
-Special Characters
+SPECIAL CHARACTERS
Here is some unicode:
@@ -567,7 +567,7 @@ Minus: -
-Links
+LINKS
Explicit
@@ -649,7 +649,7 @@ Auto-links should not occur here: <http://example.com/>
-Images
+IMAGES
From “Voyage dans la Lune” by Georges Melies (1902):
@@ -662,7 +662,7 @@ Here is a movie [movie] icon.
-Footnotes
+FOOTNOTES
Here is a footnote reference,[1] and another.[2] This should _not_ be a