web commit by intrigeri: initial bug submission
[ikiwiki.git] / doc / bugs / Toc_map_and_template_plugins_do_not_play_well_together.mdwn
1 I've got a wiki page that contains :
2
3         [[!toc ]]
4         
5         # header1
6         
7         content1
8                 
9         # header2
10         
11         \[[!template id=bla]]
12
13 And `templates/bla.mdwn` contains :
14
15         # header3
16         
17         content3
18         
19         # header4
20         
21         content4
22
23 If no `[[!map]]` directive is anywhere in the template, the page is rendered as expected.
24
25 If `[[!map]]` is used e.g. in content4, the wiki page is rendered with
26 the following elements :
27
28 - an empty toc div
29 - every markdown code before the first `\[[!map]]` directive is not
30   interpreted and rendered as-is : `# header1 content1 # header2
31   content2 #header3 #header4 content4_before_the_map`
32 - the correctly rendered map directive result
33
34 If `\[[!map]]` is used in content3, the wiki page is rendered with
35 the following elements :
36
37 - a TOC containing only the last header (header4)
38 - every markdown code before the first `\[[!map]]` directive is not
39   interpreted and rendered as-is : `# header1 content1 # header2
40   content2 #header3 content3_before_the_map`
41 - content3 (starting at the map), header4 and content4 are all rendered as expected
42
43 Moving the `\[[!toc]]` directive from the page to the template gives the same results.
44
45 Removing the `\[[!toc]]` directive or moving it at the end of the page
46 makes the whole wiki page be rendered as expected.
47
48 Hint : in all cases, the non-interpreted markdown code is copied as-is
49 in the HTML output, without any leading `<p>` or any HTML formatting.