X-Git-Url: https://sipb.mit.edu/gitweb.cgi/ikiwiki.git/blobdiff_plain/8ba2497a23f71f3678caa9d3d6fbb31910e0508e..76746c5fe6a8e851b971c8222a4929fe3be7f60a:/doc/bugs/Toc_map_and_template_plugins_do_not_play_well_together.mdwn diff --git a/doc/bugs/Toc_map_and_template_plugins_do_not_play_well_together.mdwn b/doc/bugs/Toc_map_and_template_plugins_do_not_play_well_together.mdwn index c4380ddc2..4849edd63 100644 --- a/doc/bugs/Toc_map_and_template_plugins_do_not_play_well_together.mdwn +++ b/doc/bugs/Toc_map_and_template_plugins_do_not_play_well_together.mdwn @@ -1,49 +1,30 @@ -I've got a wiki page that contains : +The following renders incorrectly: - [[!toc ]] - - # header1 - - content1 - - # header2 - - \[[!template id=bla]] - -And `templates/bla.mdwn` contains : - - # header3 - - content3 - - # header4 - - content4 + \[[!toc ]] -If no `\[[!map]]` directive is anywhere in the template, the page is rendered as expected. - -If `\[[!map]]` is used e.g. in content4, the wiki page is rendered with -the following elements : + # header1 -- an empty toc div -- every markdown code before the first `\[[!map]]` directive is not - interpreted and rendered as-is : `# header1 content1 # header2 - content2 #header3 #header4 content4_before_the_map` -- the correctly rendered map directive result + content1 -If `\[[!map]]` is used in content3, the wiki page is rendered with -the following elements : + # header2 -- a TOC containing only the last header (header4) -- every markdown code before the first `\[[!map]]` directive is not - interpreted and rendered as-is : `# header1 content1 # header2 - content2 #header3 content3_before_the_map` -- content3 (starting at the map), header4 and content4 are all rendered as expected + \[[!map pages="sandbox"]] -Moving the `\[[!toc]]` directive from the page to the template gives the same results. Removing the `\[[!toc]]` directive or moving it at the end of the page makes the whole wiki page be rendered as expected. Hint : in all cases, the non-interpreted markdown code is copied as-is in the HTML output, without any leading `

` or any HTML formatting. + +> You're using the old version of `markdown`, that is known to have a broken block +> html parser, that will get confused if markdown is present between two +> separate html blocks, and not format the markdown. +> +> This is fixed in [[!cpan Text::MarkDown]] 1.0.19. markdown 1.0.2 also +> fixes the problem. Install either one. I'm going to make ikiwiki's +> dependencies list Text::Markdown before markdown, since people keep +> stumbling over this. (The downside is that the old broken markdown is +> faster). --[[Joey]] + +[[done]]