− | -- @test mw.log(p.table({ args = { [1]='[ { "name": "24h Clock", "author": "Lajna", "id": "Lajna.24hClock", "nexus": 1695, "github": "LajnaLegenden/Stardew_Valley_Mods", "brokeIn": "SMAPI 3.0", "unofficial": [ "1.0.1-unofficial.1-pathoschild", "https://community.playstarbound.com/threads/updating-mods-for-stardew-valley-1-3.142524/page-76#post-3342641" ] } ]' }})) | + | -- @test mw.log(p.table({ args = { [1]='[ { "name": "24h Clock", "author": "Lajna", // test\n"id": "Lajna.24hClock", "nexus": 1695, "github": "LajnaLegenden/Stardew_Valley_Mods", "brokeIn": "SMAPI 3.0", "unofficial": [ "1.0.1-unofficial.1-pathoschild", "https://community.playstarbound.com/threads/updating-mods-for-stardew-valley-1-3.142524/page-76#post-3342641" ] } ]' }})) |
− | local json = string.gsub(frame.args[1], ' *//[^"\r\n]+$', '') | + | local json = string.gsub(frame.args[1], '%s*//[^"\n]+', '') |
| local data = mw.text.jsonDecode(json, mw.text.JSON_TRY_FIXING) | | local data = mw.text.jsonDecode(json, mw.text.JSON_TRY_FIXING) |