aboutsummaryrefslogtreecommitdiff
path: root/doc/bugs/Inlining_adds_newlines_which_can_break_markdown.mdwn
blob: 3928c219297971b316e927223716ab1f2c9cfe5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
I'm trying to put a list of tags in a table, so I carefully make a newline-free taglist.tmpl and then do:

    | \[[!inline pages="link(/category/env)" feeds=no archive=yes sort=title template=taglist]] |

but there's a line in `inline.pm` that does:

    return "<div class=\"inline\" id=\"$#inline\"></div>\n\n";

And the extra newlines break the table.  Can they be safely removed?

> If you want an HTML table, I would suggest using an HTML table, which
> should pass through Markdown without being interpreted further. To
> avoid getting the `<div>` inside the `<table>` you can use:
>
>     \[[!inline pages="link(/category/env)" feeds=no archive=yes sort=title template=tagtable]]
>
> where tagtable.tmpl looks like
>
>     <TMPL_IF FIRST>
>     <table><tr>
>     </TMPL_IF>
>
>     <td>your tag here</td>
>
>     <TMPL_IF LAST>
>     </tr></table>
>     </TMPL_IF>
>
> I don't think you're deriving much benefit from Markdown's table syntax
> if you have to mix it with HTML::Template and ikiwiki directives,
> and be pathologically careful with whitespace. "Right tool for the job"
> and all that :-)
>
> When I edited this page I was amused to find that you used HTML,
> not Markdown, as its format. It seems oddly appropriate to my answer, but
> I've converted it to Markdown and adjusted the formatting, for easier
> commenting.
> --[[smcv]]