User:Writ Keeper/logs

[17:47] Writ_Keeper    hi all; anyone here familiar with how sections work in mediawiki? [17:47] Writ_Keeper    i'm looking at extractSections in parser.php and wondering if that's a good place to start [17:49] MatmaRex       Writ_Keeper: the only person who's really familiar with the parser is TimStarling, and he's away and in Australia. but ask away. [17:49] Writ_Keeper    hm. [17:50] Writ_Keeper    well, there's a common complaint on a project on enwiki about section numbering [17:50] Writ_Keeper    the project is set up to be top-posting rather than bottom-posting [17:50] Writ_Keeper    and that breaks the section numbering [17:51] Writ_Keeper    if someone creates a new section above you while you're editing a different one, your edit goes to the wrong section, since your section id is out of sync [17:52] Writ_Keeper    I replied to someone who complained that it would be a major efort to fix that, since it would presumably involve rewriting the parser or something [17:52] Writ_Keeper    and wanted to find out what it would *actually* take [17:52] Writ_Keeper    so [17:52] DanielK_WMDE    Writ_Keeper: it's not easy to fix, but possible. [17:52] Writ_Keeper    if anyone has any ideas on that, or where to begin researching it, that'd be cool [17:53] DanielK_WMDE   Writ_Keeper: sections headers contain id-attributes, sou you can link to them. That ID could be used insead of the section number to identify the section. [17:53] DanielK_WMDE   completely replacing the old system would be hard, but one could transmit that ID in addition to the section number, and then double-check before saving [17:54] DanielK_WMDE   that would generate an edit conflict. still better than the current situation. [17:54] Writ_Keeper    is that something taht has to be done on your end, or is that already available to the client? [17:54] DanielK_WMDE   It could be done on the server, most likely in EditPage.php [17:55] DanielK_WMDE   hm... but... [17:55] DanielK_WMDE   well, that ID is present in the generated HTML, not in the wikitext [17:55] Writ_Keeper    wher is it in the HTML? [17:55] DanielK_WMDE   that makes it hard to do this on the client side [17:55] DanielK_WMDE   Writ_Keeper: can you link me to the page in question? [17:56] DanielK_WMDE   for a more relevant example [17:56] Writ_Keeper    https://en.wikipedia.org/wiki/Wikipedia:TH/Q [17:56] Writ_Keeper    (the target, not the redirect, obviously) [17:56] DanielK_WMDE   Writ_Keeper: ok. so you can click on the TOV and go to https://en.wikipedia.org/wiki/Wikipedia:TH/Q#Image_licensing [17:57] DanielK_WMDE   the #Image_licensing thingy works, because the (currently) second section has that ID in the HTML code. let me find it... [17:57] Writ_Keeper    the ID of the span in the header? [17:57] Writ_Keeper    *section title [17:57] DanielK_WMDE   Writ_Keeper: yes [17:58] DanielK_WMDE    [17:58] DanielK_WMDE   inside the [17:58] Writ_Keeper    hmmm [17:58] Writ_Keeper    well, maybe I can incorprate that into our JS reply gadget [17:58] DanielK_WMDE   but for editing, you need to find the relevant place of that marker in the wikitext [17:58] DanielK_WMDE   the parser has all the necessary info for that, but in JS, that's going to be tricky [17:58] Writ_Keeper    yeah... [17:59] Writ_Keeper    wait, can I pass that to the API instead of the section number? [17:59] DanielK_WMDE   also note that the id is generated from the == section title ==, but can look rather odd when non-ascii characters are involved. [17:59] DanielK_WMDE   Writ_Keeper: no you can't. but making that work would be the way to go, imho. [18:00] DanielK_WMDE   that's the approach i'd recommend. [18:01] DanielK_WMDE   Writ_Keeper: seeper inside, the function Parser::getSection would need to work with these identifiers. [18:01] Writ_Keeper    right, which just calls extractSections in turn [18:01] DanielK_WMDE   that's probably a good starting point for a bit of code spelunking. [18:01] DanielK_WMDE   yep [18:01] Writ_Keeper    that's what I'm looking at atm