aboutsummaryrefslogtreecommitdiff
path: root/doc/bugs/Spurious___60__p__62___elements_added_to_tags_in_inliine_pages.mdwn
blob: 15f74c497dfeaf7e9053ee0abf20ff3d7a90ecdc (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
[[!tag patch]]

When a page containing tags and using the [[syntax_(3rd_party)_plugin|plugins/contrib/syntax]] (though pages using other preprocessors may also be affected) is rendered as an inline page, some extra `<p>` elements are added.

Example output:

    <p><span class="tags">
    Tags:</p>
    
    <p><span class="selflink">XML</span></p>
    
    <p></span></p>

Expected output:

    <p><span class="tags">
    Tags:
    
    <span class="selflink">XML</span>
    </span></p>

A fix is to change inlinepage.tmpl to remove new lines around tag links, as follows:

    --- templates/inlinepage.tmpl   (revision 4626)
    +++ templates/inlinepage.tmpl   (working copy)
    @@ -24,9 +24,7 @@
     <TMPL_IF NAME="TAGS">
     <span class="tags">
     Tags:
    -<TMPL_LOOP NAME="TAGS">
    -<TMPL_VAR NAME=LINK>
    -</TMPL_LOOP>
    +<TMPL_LOOP NAME="TAGS"> <TMPL_VAR NAME=LINK></TMPL_LOOP>
     </span>
     </TMPL_IF>

> I'm sure this is only working around a symptom, the problem must be that
> markdown gets confused by the html generated by the syntax plugin.
> Have you tried markdown 1.0.2? This version has a more robust html
> parser.
> 
> I don't have the prerequisites for the syntax plugin installed here
> to debug it myself. --[[Joey]]

> I don't think that this is specific to the [[syntax_(3rd_party)_plugin|plugins/contrib/syntax]].
> It's happening on my pages that just use ordinary templates.
> I've documented my versions below. --[[daveloyall]]
>
>     ikiwiki: 3.20140125
>     libtext-markdown-discount-perl: 0.11-1
>     libtext-multimarkdown-perl: 1.000034-1
>     libhtml-template-perl: 2.95-1

>> Can you show us the source code and output for a page that has this
>> bug?
>>
>> If you enable [[plugins/htmlbalance]], does the problem go away?
>> (If it does, then I think I might know what the bug is.)
>> --[[smcv]]