git.iko.soy/typeable/pandoc
on master help sign in
Implemented correct output of dokuwiki (#386)
commita43e5983da90419c5b6c01fe03febc3797c2d9aa authorClare Macrae <clare.macrae@googlemail.com> dateSun 14 Jul 2013, 14:24 (13 years ago) parent7eded47
2 files changed+32−32
src/Text/Pandoc/Writers/DokuWiki.hs+1−1 tests/writer.dokuwiki+31−31
src/Text/Pandoc/Writers/DokuWiki.hs+1−1
@@ -112,7 +112,7 @@ blockToDokuWiki _ HorizontalRule = return "\n-----\n"
112112
113113blockToDokuWiki opts (Header level _ inlines) = do
114114 contents <- inlineListToDokuWiki opts inlines
115− let eqs = replicate level '='
115+ let eqs = replicate ( 7 - level ) '='
116116 return $ eqs ++ " " ++ contents ++ " " ++ eqs ++ "\n"
117117
118118blockToDokuWiki _ (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
33
44-----
55
6−= Headers =
6+====== Headers ======
77
8−== Level 2 with an [[url|embedded link]] ==
8+===== Level 2 with an [[url|embedded link]] =====
99
10−=== Level 3 with ''emphasis'' ===
10+==== Level 3 with ''emphasis'' ====
1111
12−==== Level 4 ====
12+=== Level 4 ===
1313
14−===== Level 5 =====
14+== Level 5 ==
1515
16−= Level 1 =
16+====== Level 1 ======
1717
18−== Level 2 with ''emphasis'' ==
18+===== Level 2 with ''emphasis'' =====
1919
20−=== Level 3 ===
20+==== Level 3 ====
2121
2222with no blank line
2323
24−== Level 2 ==
24+===== Level 2 =====
2525
2626with no blank line
2727
2828
2929-----
3030
31−= Paragraphs =
31+====== Paragraphs ======
3232
3333Here’s a regular paragraph.
3434
@@ -41,7 +41,7 @@ There should be a hard line break<br />here.
4141
4242-----
4343
44−= Block Quotes =
44+====== Block Quotes ======
4545
4646E-mail style:
4747
@@ -70,7 +70,7 @@ And a following paragraph.
7070
7171-----
7272
73−= Code Blocks =
73+====== Code Blocks ======
7474
7575Code:
7676
@@ -89,9 +89,9 @@ These should not be escaped: \$ \\ \&gt; \[ \{</pre>
8989
9090-----
9191
92−= Lists =
92+====== Lists ======
9393
94−== Unordered ==
94+===== Unordered =====
9595
9696Asterisks tight:
9797
@@ -129,7 +129,7 @@ Minuses loose:
129129* Minus 2
130130* Minus 3
131131
132−== Ordered ==
132+===== Ordered =====
133133
134134Tight:
135135
@@ -163,7 +163,7 @@ Multiple paragraphs:
163163<li><p>Item 2.</p></li>
164164<li><p>Item 3.</p></li></ol>
165165
166−== Nested ==
166+===== Nested =====
167167
168168* Tab
169169** Tab
@@ -187,14 +187,14 @@ Same thing but with paragraphs:
187187#* Foe
188188# Third
189189
190−== Tabs and spaces ==
190+===== Tabs and spaces =====
191191
192192* this is a list item indented with tabs
193193* this is a list item indented with spaces
194194** this is an example list item indented with tabs
195195** this is an example list item indented with spaces
196196
197−== Fancy list markers ==
197+===== Fancy list markers =====
198198
199199<ol start="2" style="list-style-type: decimal;">
200200<li>begins with 2</li>
@@ -238,7 +238,7 @@ B. Williams
238238
239239-----
240240
241−= Definition Lists =
241+====== Definition Lists ======
242242
243243Tight using spaces:
244244
@@ -306,7 +306,7 @@ Blank line after term, indented marker, alternate markers:
306306;# sublist
307307;# sublist
308308
309−= HTML Blocks =
309+====== HTML Blocks ======
310310
311311Simple block on one line:
312312
@@ -416,7 +416,7 @@ Hr’s:
416416
417417-----
418418
419−= Inline Markup =
419+====== Inline Markup ======
420420
421421This is ''emphasized'', and so ''is this''.
422422
@@ -445,7 +445,7 @@ These should not be superscripts or subscripts, because of the unescaped spaces:
445445
446446-----
447447
448−= Smart quotes, ellipses, dashes =
448+====== Smart quotes, ellipses, dashes ======
449449
450450“Hello,” said the spider. “‘Shelob’ is my name.”
451451
@@ -466,7 +466,7 @@ Ellipses…and…and….
466466
467467-----
468468
469−= LaTeX =
469+====== LaTeX ======
470470
471471*
472472* <math>2+2=4</math>
@@ -490,7 +490,7 @@ Here’s a LaTeX table:
490490
491491-----
492492
493−= Special Characters =
493+====== Special Characters ======
494494
495495Here is some unicode:
496496
@@ -545,9 +545,9 @@ Minus: -
545545
546546-----
547547
548−= Links =
548+====== Links ======
549549
550−== Explicit ==
550+===== Explicit =====
551551
552552Just a [[url/|URL]].
553553
@@ -567,7 +567,7 @@ Just a [[url/|URL]].
567567
568568[[|Empty]].
569569
570−== Reference ==
570+===== Reference =====
571571
572572Foo [[url/|bar]].
573573
@@ -592,7 +592,7 @@ Foo [[url/|bar]].
592592
593593Foo [[url/|biz]].
594594
595−== With ampersands ==
595+===== With ampersands =====
596596
597597Here’s a [http://example.com/?foo=1&bar=2 link with an ampersand in the URL].
598598
@@ -602,7 +602,7 @@ Here’s an [[script?foo=1&bar=2|inline link]].
602602
603603Here’s an [[script?foo=1&bar=2|inline link in pointy braces]].
604604
605−== Autolinks ==
605+===== Autolinks =====
606606
607607With an ampersand: http://example.com/?foo=1&bar=2
608608
@@ -620,7 +620,7 @@ Auto-links should not occur here: <code>&lt;http://example.com/&gt;</code>
620620
621621-----
622622
623−= Images =
623+====== Images ======
624624
625625From “Voyage dans la Lune” by Georges Melies (1902):
626626
@@ -631,7 +631,7 @@ Here is a movie [[Image:movie.jpg|movie]] icon.
631631
632632-----
633633
634−= Footnotes =
634+====== Footnotes ======
635635
636636Here 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.
637637</ref> and another.<ref>Here’s the long note. This one contains multiple blocks.