]> sipb.mit.edu Git - ikiwiki.git/blob - doc/bugs/Toc_map_and_template_plugins_do_not_play_well_together.mdwn
question
[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 > Surely you mean a toc directive, not map? --[[Joey]]
29
30 - an empty toc div
31 - every markdown code before the first `\[[!map]]` directive is not
32   interpreted and rendered as-is : `# header1 content1 # header2
33   content2 #header3 #header4 content4_before_the_map`
34 - the correctly rendered map directive result
35
36 If `\[[!map]]` is used in content3, the wiki page is rendered with
37 the following elements :
38
39 - a TOC containing only the last header (header4)
40 - every markdown code before the first `\[[!map]]` directive is not
41   interpreted and rendered as-is : `# header1 content1 # header2
42   content2 #header3 content3_before_the_map`
43 - content3 (starting at the map), header4 and content4 are all rendered as expected
44
45 Moving the `\[[!toc]]` directive from the page to the template gives the same results.
46
47 Removing the `\[[!toc]]` directive or moving it at the end of the page
48 makes the whole wiki page be rendered as expected.
49
50 Hint : in all cases, the non-interpreted markdown code is copied as-is
51 in the HTML output, without any leading `<p>` or any HTML formatting.