Content deleted Content added
Line 58:
: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)
|