Last modified: 2014-09-23 23:40:42 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T7641, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 5641 - Allow named, auto-incrementing elements
Allow named, auto-incrementing elements
Status: NEW
Product: MediaWiki
Classification: Unclassified
Page editing (Other open bugs)
unspecified
All All
: Low enhancement with 2 votes (vote)
: ---
Assigned To: Nobody - You can work on this!
: newparser, parser
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-04-18 17:24 UTC by Robert Shimmin
Modified: 2014-09-23 23:40 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Patch to support this. (11.31 KB, patch)
2006-04-23 11:50 UTC, Andrew Miller
Details
Newer patch: Fix a bug, update parser tests for this patch (12.93 KB, patch)
2006-04-24 09:11 UTC, Andrew Miller
Details

Description Robert Shimmin 2006-04-18 17:24:03 UTC
A number of issues, including the (still ongoing) controversies over citation
formats, but also numbered figures, equations, etc., which must still be
numbered (see Bug 5600), and situations in which numbered lists don't work right
(see Bug 4281) would be resolved by the ability to create (possibly more than
one) named, auto-incrementing element on a page.

Suppose the markup for this is ##_name (though this markup is provided purely
for example purposes).  Then the first instance of ##_figno on a page will
produce a 1, the second a 2, and so forth.  Other counters (suppose the same
page had numbered equations, numberd by another counter ##_eqno) would not
interfere with each other.

An extension would be auto-incrementing counters using symbols other than
numerals, such as letters or Roman numberals.  Maybe ##A_name for A, B, C,
##a_name for a, b, c, ##I_name for I, II, III, ##i_name for i, ii, iii.
Comment 1 Andrew Miller 2006-04-23 11:45:44 UTC
I have written a patch to support this. I used syntax like
#{counter} First item
# Second item
# Third item
Some intervening text
#{} Fourth item
A separate list...
# First item, list two
# Second item list two
Back to the original list...
#{counter} Fifth item, list one
Skip five...
#{counter|+5} Tenth item, list one
Go to a specific number...
#{30} Thirtieth item, list two
#{counter|20} Twentieth item, list one
Comment 2 Andrew Miller 2006-04-23 11:50:03 UTC
Created attachment 1601 [details]
Patch to support this.
Comment 3 Andrew Miller 2006-04-23 11:52:24 UTC
BTW I don't have SVN access, someone please commit (to somewhere where
experimental code is allowed).
Comment 4 Andrew Miller 2006-04-24 09:11:46 UTC
Created attachment 1603 [details]
Newer patch: Fix a bug, update parser tests for this patch
Comment 5 Sumana Harihareswara 2012-01-10 23:18:16 UTC
Andrew, thank you for the patch.  I'm very sorry, but in the time since you provided your patch, MediaWiki's codebase has changed enough that your patch no longer applies cleanly to our trunk.  Therefore I'm marking it obsolete and removing the "need-review" and "patch" keywords.

We are currently rewriting the parser https://www.mediawiki.org/wiki/Future/Parser_development ; I am cc'ing Gabriel Wicke, who is one od the developers on that effort. If this issue is still one you're interested in fixing, please join us in IRC https://www.mediawiki.org/wiki/MediaWiki_on_IRC and talk with other developers before renewing and possibly revising your approach; it would be great to get your help in the rewrite.  Thanks for your interest in improving MediaWiki!  And, again, sorry for the very long delay in response.
Comment 6 Sumana Harihareswara 2012-01-10 23:18:42 UTC
Comment on attachment 1603 [details]
Newer patch: Fix a bug, update parser tests for this patch

This patch no longer applies to trunk per Rusty Burchfield's automated testing
https://docs.google.com/spreadsheet/ccc?key=0Ah_71HHl7qa7dGtvSms3TGpHQU9NU2Y1VmNzUEUteWc
.
Comment 7 Gabriel Wicke 2012-11-03 17:42:18 UTC
Could this be fully or partly solved using CSS counters? http://www.w3.org/TR/CSS21/generate.html#counters or http://dev.opera.com/articles/view/automatic-numbering-with-css-counters/ have some information about this.

Doing this in an extension would introduce a lot of dependencies between elements of a page. We are considering to do incremental updates to parts of a page DOM in the future to improve performance and responsiveness, which would be complicated by adding more dependencies.
Comment 8 Helder 2012-11-03 17:45:19 UTC
Wouldn't that require the ability to have per page/category/template/whathever CSS?
Comment 9 Gabriel Wicke 2012-11-03 18:33:37 UTC
Yes, but adding such a thing does not appear to be that hard from a technical point of view and would likely provide the mechanism for other CSS-based solutions too.

Browser support seems to be quite good already according to http://www.quirksmode.org/css/contents.html (search for counters). I did not check if the feature set is sufficient, and think it would make sense to evaluate that first.

Also relevant is the support for various list-style-type values: http://www.quirksmode.org/css/lists.html.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links