ikiwiki/doc/bugs/Inlining_adds_newlines_whic...

39 lines
1.3 KiB
Plaintext
Raw Permalink Normal View History

2014-09-09 17:04:11 +02:00
I'm trying to put a list of tags in a table, so I carefully make a newline-free taglist.tmpl and then do:
2014-09-09 19:49:10 +02:00
| \[[!inline pages="link(/category/env)" feeds=no archive=yes sort=title template=taglist]] |
2014-09-09 17:04:11 +02:00
2014-09-09 19:49:10 +02:00
but there's a line in `inline.pm` that does:
return "<div class=\"inline\" id=\"$#inline\"></div>\n\n";
2014-09-09 17:04:11 +02:00
And the extra newlines break the table. Can they be safely removed?
2014-09-09 19:45:16 +02:00
> 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:
2014-09-09 19:52:21 +02:00
>
> \[[!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>
2014-09-09 19:45:16 +02:00
>
> I don't think you're deriving much benefit from Markdown's table syntax
2014-09-09 19:52:21 +02:00
> if you have to mix it with HTML::Template and ikiwiki directives,
2014-09-09 19:45:16 +02:00
> and be pathologically careful with whitespace. "Right tool for the job"
2014-09-09 19:49:10 +02:00
> 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]]