Module talk:egy-hieroglyphs
Hieroglyphs occasionally borked on mobile
[edit]Hello @Vorziblix! Nice to meet you. :) Not sure if this is a known issue as it seems it isn't about the recent changes and has always been there, but it seems certain hieroglyphs, the ones which appear less pixelated (which in the HTML are in separate tables) as for example the left-facing moon logogram on jꜥḥ, go on new line on mobile and also on desktop whenever the window width is decreased up to a certain amount. This seems to be because of the multiple tables, and messing around with the page inspector I noticed that instead of closing the </tr></tbody></table></td></tr></tbody></table>
and then reopening it each time, treating the new image inside of the same <tr>
fixes the issue, so perhaps this could be how the module does it. (However are there occasionally multiple <tr>
s inside that <tbody>
? Because if so I'd have little to no idea how to tackle it.) Catonif (talk) 20:28, 24 September 2024 (UTC)
- @Catonif: Hello! Indeed, your diagnosis is spot-on; I’ve observed this problem for a long time. We could indeed fix it, but the fix would be complicated compared to the current stopgap solution—basically it would mean entirely reimplementing WikiHiero. The current module just makes a new WikiHiero-style table for glyphs not supported by WikiHiero, and recruits WikiHiero to take care of the rest, but the result is separate tables for each one, with no way to merge the tables together short of ditching WikiHiero entirely. (Well, maybe they could also be merged in JavaScript, but unfortunately I am not at all familiar with coding in JS.)
- The main reason I am hesitant to abandon WikiHiero and just reimplement everything in Lua is that I’m not sure how severe the impact on loading time and Lua memory would be; it would also take a good deal of work. (But some of the work is already done; some of the functions at Module:User:Vorziblix/test reimplement much of the parsing done by WikiHiero.) I’m not sure what the best course of action is here. — Vorziblix (talk · contribs) 20:58, 24 September 2024 (UTC)
- @Vorziblix Oh I see! I had assumed that by preprocessing wikicode we would get the HTML result, but I notice now that tags are actually first turned into strip markers, which prevents any direct editing of the table. I guess we probably don't want to transition away entirely from WikiHiero yet, especially given its lightness. As you mentioned however, it is indeed possible to fix this with JavaScript, as a proof of concept I have done it over at User:Catonif/hierotables.js, (I have no idea why it stops all other JS scripts when I try to import it, but works well if I copy-paste its content on common.js...) which is a very crude approach as it is a notoriously forbidden thing to parse HTML with regex, but anyways, what matters is that it is possible, so perhaps we could ask some people with greater experience with JS to do this better (if there even is a better way?), hopefully after preventing these empty tables (
<hiero></hiero>
) from being created alredy from within the module. If we want this JS solution in the first place, that is, as now that looking back to it it wouldn't exactly be the cleanest of situations. Catonif (talk) 20:55, 25 September 2024 (UTC)- Alright, I updated the module (I hope you don't mind the tabs) and updated User:Catonif/hierotables.js so that it is actually usable now. You can use
importScript("User:Catonif/hierotables.js")
in your common.js if you want to test it out. If we don't hate this solution too much we could ask the JS snippet to be set global to solve the visual issue. Catonif (talk) 21:50, 26 September 2024 (UTC)- @Catonif: Thanks! I’m giving it a test and, while it mostly works well as expected, I’m noticing some weird behavior in a few cases — check the first quotation at šzp. It seems like any text with cartouches in it is having problems. Also, hieroglyphic text with a line break (
<br>
) in it is being forced onto a single line, as with, for instance, the quote at the top of my userpage. There may be some more complications than we hoped. — Vorziblix (talk · contribs) 00:01, 27 September 2024 (UTC) - @Catonif: Hmm… looking around some more, I fear your edit to the module may have also broken something… see the garbled bottom half of the entry at hrm (it may not be immediately evident until you expand the quotation). It seems like any sign groups preceded by a tilde that feature two or more of the same glyph are no longer being processed correctly, for instance the group
~E100:xpr*xpr
in the quotation at hrm, which featuresxpr
twice. — Vorziblix (talk · contribs) 00:12, 27 September 2024 (UTC)- @Vorziblix Oop! My bad, that is true. The problem is in the module edit, which I've reverted for now. I'm fairly sure I know the reason why it happens so it shouldn't be a hard fix, I'll try to do it again this evening once I get back access to my PC. Catonif (talk) 05:06, 27 September 2024 (UTC)
- @Vorziblix Alright, I did fix the bugs mentioned (hopefully? please check). Sorry again for breaking those entries, those were predictable mistakes. Catonif (talk) 09:29, 28 September 2024 (UTC)
- @Catonif: No worries! The current version looks good to me (and all the pages with tricky glyph arrangements I checked seem to work perfectly). I think it’s ready if you want to ask for it to be set globally. (We already have one other piece of Javascript globally doing things with WikiHiero, MediaWiki:WikiHieroTempFix.js, called toward the bottom of common.js.) Many thanks again! — Vorziblix (talk · contribs) 23:28, 28 September 2024 (UTC)
- @Vorziblix Hi again! (I hope I'm not taking too much of your editing time!) I was about to start the GP discussion about this, but I had noticed another issue. On the quote hrm the glyphs in the groups
d:W*g:r
andt*t:xAst
again started to rample one on top of the other whenever the window width decreased (you can still see this behaviour if you log out, or temply remove the snippet from your JS). This, unlike the other ones, seems like a bug intrinsic of WikiHiero. I nevertheless added another replacement to the snippet to disallow wrapping in those situations. I assume this isn't a big deal, and hopefully should not cause any collateral bugs, but I thought I'd mention this here before bring the matter to GP. Catonif (talk) 17:00, 3 October 2024 (UTC)- @Catonif: You’re not taking up my time at all; thanks for doing all this. Yes, the issue you mention is indeed intrinsic to WikiHiero, and it’s been a thorn in my side for nearly a decade now. It would be wonderful to see it finally fixed—and, indeed, with your changes, it seems to be! I don’t see any collateral bugs upon testing out various inputs and checking existing pages; it all looks good to me. Much thanks again for your work! — Vorziblix (talk · contribs) 19:18, 3 October 2024 (UTC)
- @Vorziblix Hi again! (I hope I'm not taking too much of your editing time!) I was about to start the GP discussion about this, but I had noticed another issue. On the quote hrm the glyphs in the groups
- @Catonif: No worries! The current version looks good to me (and all the pages with tricky glyph arrangements I checked seem to work perfectly). I think it’s ready if you want to ask for it to be set globally. (We already have one other piece of Javascript globally doing things with WikiHiero, MediaWiki:WikiHieroTempFix.js, called toward the bottom of common.js.) Many thanks again! — Vorziblix (talk · contribs) 23:28, 28 September 2024 (UTC)
- @Vorziblix Alright, I did fix the bugs mentioned (hopefully? please check). Sorry again for breaking those entries, those were predictable mistakes. Catonif (talk) 09:29, 28 September 2024 (UTC)
- @Vorziblix Oop! My bad, that is true. The problem is in the module edit, which I've reverted for now. I'm fairly sure I know the reason why it happens so it shouldn't be a hard fix, I'll try to do it again this evening once I get back access to my PC. Catonif (talk) 05:06, 27 September 2024 (UTC)
- @Catonif: Thanks! I’m giving it a test and, while it mostly works well as expected, I’m noticing some weird behavior in a few cases — check the first quotation at šzp. It seems like any text with cartouches in it is having problems. Also, hieroglyphic text with a line break (
- Alright, I updated the module (I hope you don't mind the tabs) and updated User:Catonif/hierotables.js so that it is actually usable now. You can use
- @Vorziblix Oh I see! I had assumed that by preprocessing wikicode we would get the HTML result, but I notice now that tags are actually first turned into strip markers, which prevents any direct editing of the table. I guess we probably don't want to transition away entirely from WikiHiero yet, especially given its lightness. As you mentioned however, it is indeed possible to fix this with JavaScript, as a proof of concept I have done it over at User:Catonif/hierotables.js, (I have no idea why it stops all other JS scripts when I try to import it, but works well if I copy-paste its content on common.js...) which is a very crude approach as it is a notoriously forbidden thing to parse HTML with regex, but anyways, what matters is that it is possible, so perhaps we could ask some people with greater experience with JS to do this better (if there even is a better way?), hopefully after preventing these empty tables (