Content deleted Content added
→Call from other Lua module: looks good |
|||
(4 intermediate revisions by 3 users not shown) | |||
Line 50:
::@[[User:Trappist the monk|Trappist the monk]] Makes sense, I've updated the sandbox. <span class="nowrap">--[[User:Ahecht|Ahecht]] ([[User talk:Ahecht|<b style="color:#FFF;background:#04A;display:inline-block;padding:1px;vertical-align:middle;font:bold 50%/1 sans-serif;text-align:center">TALK<br />PAGE</b>]])</span> 19:23, 30 July 2025 (UTC)
:::The sandbox code looks good to me. I put a test at [[Module:Sandbox/Johnuniq/temp]] with result at [[Module talk:Sandbox/Johnuniq/temp|talk]]. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 04:25, 31 July 2025 (UTC)
::::{{done}} <span class="nowrap">--[[User:Ahecht|Ahecht]] ([[User talk:Ahecht|<b style="color:#FFF;background:#04A;display:inline-block;padding:1px;vertical-align:middle;font:bold 50%/1 sans-serif;text-align:center">TALK<br />PAGE</b>]])</span> 21:03, 31 July 2025 (UTC)
== Template-protected edit request on 27 August 2025 ==
{{edit template-protected|Module:Convert|answered=yes}}
Module doesn't have a fraction slash in pattern that look for floats. I added proposed change to the sanbox of the module. (It only affects in wikis that uses varname. I have already fixed it in ukwiki, but I propose my changes here aswell to make it synchronized with enwiki module.) [[User:Repakr|Repakr]] ([[User talk:Repakr|talk]]) 15:28, 27 August 2025 (UTC)
:I'll have a look a little later. We batch changes to convert so it might take a while. I'm afraid I had forgotten about our discussion at ukwiki, life got in the way. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 02:48, 28 August 2025 (UTC)
::{{ping|Repakr}} I see the change is very straightforward and, as you say, only affects sites like ukwiki which use variable names. However, <code>clean:match('[./⁄]')</code> is not correct. The fraction slash is a Unicode character which is encoded in UTF-8 here. It is three hex bytes: E2 81 84. That regex is fast because it uses Lua's built-in and simplistic procedure, namely it looks only at the bytes, not the characters. It would match anything with a dot or a slash, but also anything with the byte E2, or byte 81, or byte 84. That might be good enough for typical wikitext but I'll think about adding something with Lua's <code>find</code> or <code>mw.ustring.match</code>. Using ustring is much slower because it uses Lua code to emulate Lua's compiled-C regex—an amazing accomplishment. However, that might be simplest and very adequate. Module:Convert defines ustring = mw.ustring so the replacement would be <code>ustring.match(clean, '[./⁄]')</code>. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 06:00, 28 August 2025 (UTC)
:::Yeah, I hadn't taken into account that fraction slash is a Unicode character. Therefore, I should have used <code>mw.ustring.match</code>. As for our discussion at ukwiki, I planned to remind you by the end of this month. However, it isn't an urgent feature, so you can take as much time as you need to look into it. [[User:Repakr|Repakr]] ([[User talk:Repakr|talk]]) 09:13, 28 August 2025 (UTC)
|