git.iko.soy/typeable/pandoc
on master help sign in
Implemented correct output of dokuwiki (#386)
a43e598Clare Macrae
src/Text/Pandoc/Writers/DokuWiki.hs+1−1
@@ -112,7 +112,7 @@ blockToDokuWiki _ HorizontalRule = return "\n-----\n"
112
112
113blockToDokuWiki opts (Header level _ inlines) = do
113blockToDokuWiki opts (Header level _ inlines) = do
114 contents <- inlineListToDokuWiki opts inlines
114 contents <- inlineListToDokuWiki opts inlines
115− let eqs = replicate level '='
115+ let eqs = replicate ( 7 - level ) '='
116 return $ eqs ++ " " ++ contents ++ " " ++ eqs ++ "\n"
116 return $ eqs ++ " " ++ contents ++ " " ++ eqs ++ "\n"
117
117
118blockToDokuWiki _ (CodeBlock (_,classes,_) str) = do
118blockToDokuWiki _ (CodeBlock (_,classes,_) str) = do
tests/writer.dokuwiki+31−31
@@ -3,32 +3,32 @@ This is a set of tests for pandoc. Most of them are adapted from John Gruber’s
3
3
4-----
4-----
5
5
6−= Headers =
6+====== Headers ======
7
7
8−== Level 2 with an [[url|embedded link]] ==
8+===== Level 2 with an [[url|embedded link]] =====
9
9
10−=== Level 3 with ''emphasis'' ===
10+==== Level 3 with ''emphasis'' ====
11
11
12−==== Level 4 ====
12+=== Level 4 ===
13
13
14−===== Level 5 =====
14+== Level 5 ==
15
15
16−= Level 1 =
16+====== Level 1 ======
17
17
18−== Level 2 with ''emphasis'' ==
18+===== Level 2 with ''emphasis'' =====
19
19
20−=== Level 3 ===
20+==== Level 3 ====
21
21
22with no blank line
22with no blank line
23
23
24−== Level 2 ==
24+===== Level 2 =====
25
25
26with no blank line
26with no blank line
27
27
28
28
29-----
29-----
30
30
31−= Paragraphs =
31+====== Paragraphs ======
32
32
33Here’s a regular paragraph.
33Here’s a regular paragraph.
34
34
@@ -41,7 +41,7 @@ There should be a hard line break<br />here.
41
41
42-----
42-----
43
43
44−= Block Quotes =
44+====== Block Quotes ======
45
45
46E-mail style:
46E-mail style:
47
47
@@ -70,7 +70,7 @@ And a following paragraph.
70
70
71-----
71-----
72
72
73−= Code Blocks =
73+====== Code Blocks ======
74
74
75Code:
75Code:
76
76
@@ -89,9 +89,9 @@ These should not be escaped: \$ \\ \&gt; \[ \{</pre>
89
89
90-----
90-----
91
91
92−= Lists =
92+====== Lists ======
93
93
94−== Unordered ==
94+===== Unordered =====
95
95
96Asterisks tight:
96Asterisks tight:
97
97
@@ -129,7 +129,7 @@ Minuses loose:
129* Minus 2
129* Minus 2
130* Minus 3
130* Minus 3
131
131
132−== Ordered ==
132+===== Ordered =====
133
133
134Tight:
134Tight:
135
135
@@ -163,7 +163,7 @@ Multiple paragraphs:
163<li><p>Item 2.</p></li>
163<li><p>Item 2.</p></li>
164<li><p>Item 3.</p></li></ol>
164<li><p>Item 3.</p></li></ol>
165
165
166−== Nested ==
166+===== Nested =====
167
167
168* Tab
168* Tab
169** Tab
169** Tab
@@ -187,14 +187,14 @@ Same thing but with paragraphs:
187#* Foe
187#* Foe
188# Third
188# Third
189
189
190−== Tabs and spaces ==
190+===== Tabs and spaces =====
191
191
192* this is a list item indented with tabs
192* this is a list item indented with tabs
193* this is a list item indented with spaces
193* this is a list item indented with spaces
194** this is an example list item indented with tabs
194** this is an example list item indented with tabs
195** this is an example list item indented with spaces
195** this is an example list item indented with spaces
196
196
197−== Fancy list markers ==
197+===== Fancy list markers =====
198
198
199<ol start="2" style="list-style-type: decimal;">
199<ol start="2" style="list-style-type: decimal;">
200<li>begins with 2</li>
200<li>begins with 2</li>
@@ -238,7 +238,7 @@ B. Williams
238
238
239-----
239-----
240
240
241−= Definition Lists =
241+====== Definition Lists ======
242
242
243Tight using spaces:
243Tight using spaces:
244
244
@@ -306,7 +306,7 @@ Blank line after term, indented marker, alternate markers:
306;# sublist
306;# sublist
307;# sublist
307;# sublist
308
308
309−= HTML Blocks =
309+====== HTML Blocks ======
310
310
311Simple block on one line:
311Simple block on one line:
312
312
@@ -416,7 +416,7 @@ Hr’s:
416
416
417-----
417-----
418
418
419−= Inline Markup =
419+====== Inline Markup ======
420
420
421This is ''emphasized'', and so ''is this''.
421This is ''emphasized'', and so ''is this''.
422
422
@@ -445,7 +445,7 @@ These should not be superscripts or subscripts, because of the unescaped spaces:
445
445
446-----
446-----
447
447
448−= Smart quotes, ellipses, dashes =
448+====== Smart quotes, ellipses, dashes ======
449
449
450“Hello,” said the spider. “‘Shelob’ is my name.”
450“Hello,” said the spider. “‘Shelob’ is my name.”
451
451
@@ -466,7 +466,7 @@ Ellipses…and…and….
466
466
467-----
467-----
468
468
469−= LaTeX =
469+====== LaTeX ======
470
470
471*
471*
472* <math>2+2=4</math>
472* <math>2+2=4</math>
@@ -490,7 +490,7 @@ Here’s a LaTeX table:
490
490
491-----
491-----
492
492
493−= Special Characters =
493+====== Special Characters ======
494
494
495Here is some unicode:
495Here is some unicode:
496
496
@@ -545,9 +545,9 @@ Minus: -
545
545
546-----
546-----
547
547
548−= Links =
548+====== Links ======
549
549
550−== Explicit ==
550+===== Explicit =====
551
551
552Just a [[url/|URL]].
552Just a [[url/|URL]].
553
553
@@ -567,7 +567,7 @@ Just a [[url/|URL]].
567
567
568[[|Empty]].
568[[|Empty]].
569
569
570−== Reference ==
570+===== Reference =====
571
571
572Foo [[url/|bar]].
572Foo [[url/|bar]].
573
573
@@ -592,7 +592,7 @@ Foo [[url/|bar]].
592
592
593Foo [[url/|biz]].
593Foo [[url/|biz]].
594
594
595−== With ampersands ==
595+===== With ampersands =====
596
596
597Here’s a [http://example.com/?foo=1&bar=2 link with an ampersand in the URL].
597Here’s a [http://example.com/?foo=1&bar=2 link with an ampersand in the URL].
598
598
@@ -602,7 +602,7 @@ Here’s an [[script?foo=1&bar=2|inline link]].
602
602
603Here’s an [[script?foo=1&bar=2|inline link in pointy braces]].
603Here’s an [[script?foo=1&bar=2|inline link in pointy braces]].
604
604
605−== Autolinks ==
605+===== Autolinks =====
606
606
607With an ampersand: http://example.com/?foo=1&bar=2
607With an ampersand: http://example.com/?foo=1&bar=2
608
608
@@ -620,7 +620,7 @@ Auto-links should not occur here: <code>&lt;http://example.com/&gt;</code>
620
620
621-----
621-----
622
622
623−= Images =
623+====== Images ======
624
624
625From “Voyage dans la Lune” by Georges Melies (1902):
625From “Voyage dans la Lune” by Georges Melies (1902):
626
626
@@ -631,7 +631,7 @@ Here is a movie [[Image:movie.jpg|movie]] icon.
631
631
632-----
632-----
633
633
634−= Footnotes =
634+====== Footnotes ======
635
635
636Here is a footnote reference,<ref>Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.
636Here is a footnote reference,<ref>Here is the footnote. It can go anywhere after the footnote reference. It need not be placed at the end of the document.
637</ref> and another.<ref>Here’s the long note. This one contains multiple blocks.
637</ref> and another.<ref>Here’s the long note. This one contains multiple blocks.