Last modified: 2011-03-13 18:06:22 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 T12588, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 10588 - specific id or class for the first <p> of an article
specific id or class for the first <p> of an article
Status: RESOLVED WONTFIX
Product: MediaWiki
Classification: Unclassified
Parser (Other open bugs)
unspecified
All All
: Lowest enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-07-15 06:31 UTC by italvet
Modified: 2011-03-13 18:06 UTC (History)
1 user (show)

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


Attachments

Description italvet 2007-07-15 06:31:19 UTC
Like <h1 class="firstHeading">, a <p class="firstParagraph"> should be really useful for javascript catchers. When there are diambiguations links or pictures between the first heading and the first paragraph, the javascript for catch the first paragraph becomes very tricky, and a simple class or id could make it more simple.

Furthermore, because the first paragraph have a special status in a wikipedia page (bounds the #toc, defines the subject, includes the infobox, etc.) a DOM identifer could help in many other cases.
Comment 1 italvet 2007-07-15 06:35:23 UTC
i set the priority high beause this problem stops me in a javascript i'm coding. I don't know exactly how priority grading system works, so feel free to change it.
Comment 2 Aryeh Gregor (not reading bugmail, please e-mail directly) 2007-07-15 07:50:25 UTC
The first <p> is exactly that, the first <p>.  JavaScript can trivially be written to retrieve it, for instance (not tested but you get the idea):

element = document.getElementById( 'bodyContent' ).firstChild;
while( true ) {
	if( element.nodeType == 1 && element.nodeName == 'p' ) break;
	else element = element.nextSibling();
}

This looks like an extremely narrow request that would be of use to very few.

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


Navigation
Links