Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Page MenuHomePhabricator

Diff for Lua code module should always have LTR dir when using the inline preview tool
Closed, ResolvedPublic

Description

When editing Lua module in Wikipedia, "show diff" in RTL languages wikis shows the diff of the code in RTL directionality.
Lua is written in latin alphabet ("if", "function") hence should always have LTR directionality.

This happen when setting "Show previews without reloading the page" in preferences

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

@eranroz which WMF project do you see this issue on? When I looked at a Lua Module's diff on fawiki, the <table> element wrapping the diff correctly had the class diff-contentalign-left and that is also the same thing we see with JS pages.

it seems like I missed important setting that is required to fail here: "Show previews without reloading the page"

Change 712929 had a related patch set uploaded (by Eranroz; author: Eranroz):

[mediawiki/core@master] Code refactor for quick preview

https://gerrit.wikimedia.org/r/712929

I find the code of quick preview to be quite messy. The above patch just trying to do minor refactor to make the code cleaner before actually touching it and improving the diff part

Jdforrester-WMF renamed this task from Diff for Lua code module should always have LTR dir to Diff for Lua code module should always have LTR dir when using the inline preview tool.Aug 15 2021, 6:38 PM

Change 712929 merged by jenkins-bot:

[mediawiki/core@master] Code refactor for quick preview

https://gerrit.wikimedia.org/r/712929

@eranroz First off, thank you for the refactor in https://gerrit.wikimedia.org/r/712929 ! Community-Tech is now trying to iron out remaining bugs in Live Preview (aka "Show previews without reloading the page").

Are you still working on this? If not we're happy to take it on. This bug should be fairly easy to fix; I think we'd just need to check the content type and if it's Scribunto, omit passing the uselang parameter in the POST request.

I forgot about this. thanks for the reminder. Addressed good comment from matmarex in the review

matmarex subscribed.

This was resolved by another patch from @eranroz: https://gerrit.wikimedia.org/r/c/mediawiki/core/+/712968. I didn't realize that it wasn't connected to the task, oops.