MediaWiki talk:Common.js

Submitted script change 189536 rejected
The recently submitted change to this JavaScript page (revision 189536) was rejected by the FANDOM review process. Please make sure you meet the Custom JavaScript guidelines.

Hey there :) While I've technically "rejected" your code today, I'd prefer to think that I'm just holding it up to ask a question. With your   and   variables, there doesn't seem to be a specific act of sanitisation in place. Just to be extra safe, would it be possible to escape these variables?  CzechOut 16:27, May 14, 2020 (UTC)

Hi, I'm the one who wrote this script, and I'm just wondering what you mean by escaping the variables. I'm just not quite clear on what's being asked. Is there some documentation I can refer to in order to do this? What the script is doing for the  variable is just taking from the table cell which already exists and moving it over to the adjacent element, so are you saying this would need to be cleaned up in some way? If so how would it be best to go about it? For the  variable, it's either set to an empty string, or one of the pre-defined array items. I'm not quite sure what needs to be adjusted in this scenario. If some further clarification could be provided, I'd be happy to update it to specifications. Hajike Tobiume (talk) 16:52, May 14, 2020 (UTC)

As an addendum to my previous comment, if the issue is using innerHTML, unfortunately, I don't believe there's a workaround, at least not for. This is due to how MediaWiki parses the wikicode for tables. It's not consistent when people do or do not use a new line before starting their text inside the wiki table, and when they neglect to add a new line, it puts text directly into the. This initially isn't an issue, as I had written a work around, but it became problematic when there was also bold or italicized text in that same line of text. Hajike Tobiume (talk) 17:10, May 14, 2020 (UTC)

Hello; this is the admin that edited in the script and submit it for review. I'm confirming that User:Hajike Tobiume put together the script as a user contribution and should probably be the one to answer any questions about it, since I'm not familiar with the workings of JS myself.

Lovedelivery (talk) 00:57, May 16, 2020 (UTC)