Last modified: 2014-02-12 23:55:22 UTC
Hi. I'm developing a script with GreaseMonkey with a series of articles of extinct animals, such as Toxodon (http://es.m.wikipedia.org/wiki/Toxodon). In all the articles, the title of the animal is displayed on the HTML element called firstHeading, but there is one and only one who has no first heading. Shouldn't have all items the same basic structure? The article is the next: http://es.m.wikipedia.org / wiki / Megalonyx And where is the title is in h1.#section_0 instead of firstHeading . I thought it was some editing mistake, and that the articles editor would let me change the HTML to fix it, but can not find how. Clarified that this happens only with the mobile version url. In desktop version all items use the same template.
* HTML output is decided by the Skin, not by the MediaWiki parser * You're confusing the Vector skin with the MobileFrontend skin. Vector uses h1.firstHeading and h1#firstHeading. MobileFrontend doesn't have a class on the heading and uses id "#section_" * Both the links you're providing are of the mobile site and neither has "firstHeading" they both have "section_0": http://es.m.wikipedia.org/wiki/Toxodon http://es.m.wikipedia.org/wiki/Megalonyx
FWIW although MediaWiki allows you to insert multiple h1s into an article via = heading = I think this is wrong in the context of MediaWiki. A page should only have one h1. For the purpose of a script you can just access the h1 or the first h1 if the wiki does tend to disobey this rule. You shouldn't need a class or id.