https://bugzilla.wikimedia.org/show_bug.cgi?id=16330


Rupert Millard <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]
         Depends on|                            |15712




--- Comment #3 from Rupert Millard <[email protected]>  2008-12-31 
11:23:08 UTC ---
Nicholas,

I agree that not being able to reference footnotes is a real deficiency of
Cite.php, and was about to fix this until I came across this bug. How close are
you to a fix? (I don't want to reinvent the wheel.)

The reason you had to use the #tag magic word is to circumvent the regexp on
Cite_body.php:161 which was added to fix bug 6199 - that unbalanced refs do not
generate an error. The "fix" was not very good solution for two reasons:
# You were able to side-step it with the #tag magic word
# It doesn't work if the last <ref> isn't closed (bug 15712, which I've marked
as a dependency of this bug)

Clearly if the Cite extension is not meant to support nesting <refs>, the
regexp on Cite_body.php needs to be improved to resist the #tag magic word, and
bug 15712 needs to be fixed.

However, I think it ought to support nesting refs in cases where this would
make sense - ie. <ref group="g0"><ref group="g1">...<ref
group="gn">...</ref>...</ref></ref> providing g0!=g1!=gn and the <references />
tags are used in the correct order <references group="g0" />...<references
group="gn" />

In either case, if a </ref> tag is missing, output shouldn't be chomped as it
is currently - instead the text between the unclosed ref tag and the next
opening one should go to the appropriate reference/footnote. In the latter
case, the reference numbing needs to be correct. I think the way to do this
would be to defer parsing of the contents of <ref> tags until the <references
/> tag that displays them.

This just leaves the problem that the parser passes the text between a <ref>
and the first following </ref>, without regard for nesting, etc. (I'm sure you
know this already.) I think improving extractTagsAndParams in Parser.php is a
necessary prerequisite for enabling nested <ref>s, but I'd be interested to
hear your opinion. One would have to be very careful about breaking current
behaviour - I think it would be necessary in fact to differentiate between tags
you can nest in, and tags that you can't - tags are opened all the time within
<nowiki> elements, and the parser should not ignore the closing tag because of
them. Of course what MW really needs is a proper parser, but that's too hard!

Best wishes,

Rupert


-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to