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


Mr.Z-man <mrzmanw...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WORKSFORME                  |




--- Comment #3 from Mr.Z-man <mrzmanw...@gmail.com>  2009-01-10 18:49:01 UTC ---
(In reply to comment #2)
> (In reply to comment #1)
> > And the action=parse method only works as it provides the full list of 
> > sections
> > in order, to compare the names. The section numbers that it returns are not 
> > the
> > same as the section numbers used for editing/getting revision text.
> > 
> 
> The section numbers it returns aren't the same, that's correct. The right
> section numbers are easy to get by simply counting (1 is the first section, 2
> the second, etc.). Using this method, getting the section number given a
> section name is trivial.

That method doesn't work if the page has sections transcluded from templates. 

See for example http://en.wikipedia.org/w/index.php?oldid=263214281 

Sections transcluded from templates are given a different section number and
skipped in the normal count. On that page, the first 2 and the fourth section
are made on the page itself, the third and last 2 are transcluded from 2
different templates. 

So the actual section numbering goes: 1, 2, template1 T-1, 3, template2 T-1,
template2 T-2. The action=parse results don't indicate this -
http://en.wikipedia.org/w/api.php?action=parse&text={{User:Mr.Z-man/Sandbox}}__TOC__&prop=sections&oldid=263214281

Just counting them would give wrong numbers for all but the first 2 sections
and there doesn't seem to be an easy way to filter out sections from templates.
Ideally the API would return the section number used for section editing and
indicate which sections come from templates, rather than the TOC section
number, which is basically useless.


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

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to