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