Wikiorðabók iswiktionary https://is.wiktionary.org/wiki/Wikior%C3%B0ab%C3%B3k:Fors%C3%AD%C3%B0a MediaWiki 1.47.0-wmf.17 case-sensitive Miðill Kerfissíða Spjall Notandi Notandaspjall Wikiorðabók Wikiorðabókarspjall Mynd Myndaspjall Melding Meldingarspjall Snið Sniðaspjall Hjálp Hjálparspjall Flokkur Flokkaspjall Viðauki Viðaukaspjall Samheitasafn Samheitasafnsspjall Skjátexti Skjátextaspjall Module Module talk Event Event talk verða 0 5876 392409 392341 2026-08-29T06:09:35Z Ow! That Hurts! 8952 392409 wikitext text/x-wiki ==Íslenska== {{Sagnbeyging| ég-nútíð=[[verð]] |þú-nútíð=[[verður]] |hann-nútíð=[[verður]] |við-nútíð=[[verðum]] |þið-nútíð=[[verðið]] |þeir-nútíð=[[verða]] |Þátíð=[[varð]] |Lýsingarháttur þátíðar=[[orðið]] |Viðtengingarháttur=[[verði]] |Boðháttur=[[vertu]] |allar sagnbeygingar=verða/sagnbeyging }} ===Aðrar orðmyndir=== * [[verda]] (''fyrir Ð'') ===Sagnorð=== '''verða'''; {{so.s.b.}} {{hjálparsögn-is}} # (''[[w:tengisögn|tengisögn]]'') fara í eitthvert ástand; [[gera|gerast]], [[breytast í]] {{tilvitnun|is|lítill=sem löguð mun verða eptir textanum|margur=[[hvað|Hvað]] mikils sögur þessar hafa í Utlöndum metnar verið, lýsir það því, meðal annars, að þó sá lærði Prófessor við Háskólann í Berlín [[von der Hagen#Þýska|von der Hagen]] árið 1814 gæfi út mikinn part þeirra á Islenzku og þýzku, hafa þær í Þýzkalandi enn svo marga vini, að hann nýlega hefir aptr boðað útgáfu þeirra á þýzka túngu, sem löguð mun verða eptir textanum í því að framan boðna sögusafni.|höfundur=[[w:Carl Christian Rafn|Rafn]]|árið=1826|dagsetning=10. apríl 1826|fullur höfundur=[[w:Carl Christian Rafn|Carl Christian Rafn]]|full tilvitnun=„Fornaldar Sögur Norðrlanda“, í ''[[w:Frétt|Frèttir]]'', [[w:Kaupmannahöfn|Kaupmannahöfn]], [https://timarit.is/page/1992949?iabr&#61;on síða 88]}} # (''[[w:háttarsögn|háttarsögn]]'') [[gera]] sem boðorð eða fyrirmæli til að framkvæma setningarumsögnina, en ef það er ekki gert hefur það í för með sér mistök eða neikvæðar afleiðingar; [[þurfa]], [[hljóta]], [[mega til]] # [[koma fyrir]] # (''í [[w:Tíðbeyging sagna|nútíð]]'') ''framtíð af'' [[vera]] ====Orðsifjafræði==== Úr [[w:Norræna|norrænu]] [[verða#Norræna|''verða'']], úr [[w:Frumgermanska|frumgermönsku]] ''[[*werþaną]]'' (með sömu orðskýringum), úr [[w:Frumindóevrópska|frumindóevrópsku]] ''[[*wert-]]'' (snúa). Frumindóevrópska orðskýringin „snúa“ þróaðist yfir í frumgermönsku með því að fyrst færast yfir í „snúa í“ og upprunalega orðskýringin var líklega þegar glatuð í frumgermönsku (finnst ekki í neinum germönskum tungumálum).<ref>Vladimir Orel (2003), „*werþanan“, í ''A Handbook of Germanic Etymology'' [Handbók um germanska orðsifjafræði], [[w:Leiden|Leiden]], [[w:Boston|Boston]]: Brill, [https://archive.org/details/Orel-AHandbookOfGermanicEtymology/page/n495/mode/2up síður 457–458]</ref><ref>Guus Kroonen (2013), „*werþan-“, í ''Etymological Dictionary of Proto-Germanic'' [''Orðsifjafræðileg orðabók frumgermönsku''] (Leiden Indo-European Etymological Dictionary Series [Indóevrópska orðsifjaorðabókaröð Leiden]; 11), [[w:Leiden|Leiden]], [[w:Boston|Boston]]: Brill, [https://archive.org/details/etymological-dictionary-of-proto-germanic/page/580/mode/2up síður 581–582]</ref> ====Orðtök, orðasambönd==== [[verði þér að góðu]], [[verða að]], [[verða af]], [[verða á]], [[verða eftir]], [[verða fyrir]], [[verða ofan á]], [[verða til]], [[verða um]], [[verða undir]], [[verða úr]], [[verða úti]], [[verða við]] ====Þýðingar==== {{þýðingar|gerast |en= {{þýðing|en|become}} |cs= {{þýðing|cs|stát se}} |de= {{þýðing|de|werden}} }} {{þýðingar|þurfa |da= {{þýðing|da|måtte}}, {{þýðing|da|skulle}} |no= {{þýðing|no|måtte}} |nb= {{þýðing|nb|måtta}} |sv= {{þýðing|sv|måste}} |fo= {{þýðing|fo|skula}}, {{þýðing|fo|mega}}, {{þýðing|fo|noyðast}} |en= {{þýðing|en|must}} |es= {{þýðing|es|deber}}, {{þýðing|es|tener que}} |cs= {{þýðing|cs|muset}} |de= {{þýðing|de|müssen}}, {{þýðing|de|sollen}} }} {{þýðingar|koma fyrir |en= {{þýðing|en|occur}} |de= {{þýðing|de|geschehen}} }} {{þýðingar|''framtíð af'' vera |en= [[will#Enska|will]] [[be#Enska|be]] |de= {{þýðing|de|werden}} }} ===Tilvísun=== <references/> {{Ref-Orðabók Háskólans|ver%F0a}} {{Ref-IcelandicOnlineDictionary|verða}} {{Ref-Islex|45122|verða}} kq85hw26eor03kwjkfumsgz9vnffmya abbadís 0 15816 392423 237440 2026-08-29T08:38:44Z Ow! That Hurts! 8952 meira er að koma 392423 wikitext text/x-wiki ==Íslenska== {{Fallbeyging kvk sb 01|abbadís}} [[File:Catherine of Sweden (1244) effigy 1905.jpg|thumb|Mynd Katrínar Súnadóttur, einu sinni drottning Svíþjóðar sem gerðist '''abbadís''' eftir að hún varð ekkja, á gröf sinni.]] ===Nafnorð=== '''abbadís''' {{kvk.}}; {{no.s.b.}} # NOM3; forstöðukona [[nunnuklaustur]]s {{stenst á|is|ábóti}} {{tilvitnun|is|lítill=að verða abbadís í klaustri nokkru|margur=[[fjellzt|Fjellzt]] hún á þá uppástungu bróðir síns, að verða abbadís í klaustri nokkru, er lá á bakka Rínfljótsins skammt frá kastala föður hennar.|höf=[[w:Steingrímur Thorsteinsson|Thorsteinsson]]|árið=1859|fhöf=[[w:Steingrímur Thorsteinsson|Steingrímur Thorsteinsson]]|dag=1. janúar 1859|ftil=„Hólmgangan“, í ''Ný sumargjöf'', [[w:Kaupmannahöfn|Kaupmannahöfn]]: forlag [[w:Páll Sveinsson|Páls Sveinssonar]], [https://timarit.is/page/2037460?iabr=on síður 8–9]}} {{tilvitnun|is|lítill=skildi Halldóra abbadís senda menn norður|margur=[[var|Var]] för hans þangað ráðin, og skildi Halldóra abbadís senda menn norður í móti honum um sumarið.|höf=Helgadóttir|árið=1961|fhöf=Guðrún Pálína Helgadóttir|ftil=''Skáldkonur fyrri alda'', Kvöldvökuútgáfan, [https://www.google.com/books/edition/Sk%C3%A1ldkonur_fyrri_alda/nuMuAAAAIAAJ?hl=de&gbpv=1&bsq=%22abbad%C3%ADs%22&dq=%22abbad%C3%ADs%22&printsec=frontcover síða 82]}} {{tilvitnun|is|lítill=[[hún|Hún]] var … abbadís|margur=[[á|Á]] 12. öld var uppi kona í Þýskalandi og var henni margt til lista lagt. [[hún|Hún]] var guðfræðingur, nunna og abbadís, dulspekingur og prédikari, ljóðskáld og rithöfundur, náttúrufræðingur, lyfjafræðingur, myndlistarmaður og síðast en ekki síst tónskáld. [[hvað|Hvað]] hét þessi fjölhæfa kona?|höf=[[w:Illugi Jökulsson|Jökulsson]]|fhöf=[[w:Illugi Jökulsson|Illugi Jökulsson]]|árið=2021|dag=29. janúar 2021|ftil=„[https://heimildin.is/grein/12819/ 278. spurningaþraut: Stór höf, Rúm eru hættuleg, Noregskóngur og fræg abbadís]“, í ''[[w:Heimildin|Heimildin]]''}} {{s.e.|+=já}} [[biskup]], [[klausturfólk]], [[munkur]], [[nunna]], [[páfi]] # (''staðbundið'') [[óknyttakvendi]], [[harðduglegur|harðdugleg]] kona ====Orðsifjafræði==== Erft úr [[w:norræna|norrænu]] ''[[abbadís#Norræna|abbadís]]'', sem er önnur orðmynd af norrænu ''[[abbatissa#Norræna|abbatissa]]''/''[[abbadissa#Norræna|abbadissa]]''. Samkvæmt Magnússyni (1989) og Schmid (2001) er norræna ''abbatissa'' sjálft annaðhvort: * fengið úr [[w:Fornenska|fornensku]] og [[w:Miðlágþýska|miðlágþýsku]] ''[[abbadisse]]'', fengið úr [[w:Latína|latnesku]] ''[[abbatissa]]''; * fegnið beint úr latnesku ''abbatissa''. {{-þýðingar-}} {{þýðingar |en= {{þýðing|en|abbess}} |fi= {{þýðing|fi|abbedissa}} |grc= {{þýðing|grc|ἡγουμένη}} |fr= {{þýðing|fr|abbesse}} |el= {{þýðing|el|ηγουμένη}} |nl= {{þýðing|nl|abdis}} |it= {{þýðing|it|badessa}}, {{þýðing|it|abadessa}}, {{þýðing|it|abbadessa}} |ca= {{þýðing|ca|abadessa}} |la= {{þýðing|la|abbātissa}} |no= {{þýðing|no|abbedisse}} |pt= {{þýðing|pt|abadessa}} |ro= {{þýðing|ro|egumenă}}, {{þýðing|ro|stareţă}} |ru= {{þýðing|ru|игуменья}}, {{þýðing|ru|аббатиса}}, {{þýðing|ru|настоятельница монастыря}} |es= {{þýðing|es|abadesa}} |sv= {{þýðing|sv|abbedissa}} |de= {{þýðing|de|Äbtissin}} }} {{-tilvísun-}} {{Wikipedia|abbadís}} {{Ref-Orðabók Háskólans|abbad%EDs}} thbua6l8hn36rivbgf05d18b9c0703y 392424 392423 2026-08-29T08:39:43Z Ow! That Hurts! 8952 þetta var bara fyrir mig 392424 wikitext text/x-wiki ==Íslenska== {{Fallbeyging kvk sb 01|abbadís}} [[File:Catherine of Sweden (1244) effigy 1905.jpg|thumb|Mynd Katrínar Súnadóttur, einu sinni drottning Svíþjóðar sem gerðist '''abbadís''' eftir að hún varð ekkja, á gröf sinni.]] ===Nafnorð=== '''abbadís''' {{kvk.}}; {{no.s.b.}} # forstöðukona [[nunnuklaustur]]s {{stenst á|is|ábóti}} {{tilvitnun|is|lítill=að verða abbadís í klaustri nokkru|margur=[[fjellzt|Fjellzt]] hún á þá uppástungu bróðir síns, að verða abbadís í klaustri nokkru, er lá á bakka Rínfljótsins skammt frá kastala föður hennar.|höf=[[w:Steingrímur Thorsteinsson|Thorsteinsson]]|árið=1859|fhöf=[[w:Steingrímur Thorsteinsson|Steingrímur Thorsteinsson]]|dag=1. janúar 1859|ftil=„Hólmgangan“, í ''Ný sumargjöf'', [[w:Kaupmannahöfn|Kaupmannahöfn]]: forlag [[w:Páll Sveinsson|Páls Sveinssonar]], [https://timarit.is/page/2037460?iabr=on síður 8–9]}} {{tilvitnun|is|lítill=skildi Halldóra abbadís senda menn norður|margur=[[var|Var]] för hans þangað ráðin, og skildi Halldóra abbadís senda menn norður í móti honum um sumarið.|höf=Helgadóttir|árið=1961|fhöf=Guðrún Pálína Helgadóttir|ftil=''Skáldkonur fyrri alda'', Kvöldvökuútgáfan, [https://www.google.com/books/edition/Sk%C3%A1ldkonur_fyrri_alda/nuMuAAAAIAAJ?hl=de&gbpv=1&bsq=%22abbad%C3%ADs%22&dq=%22abbad%C3%ADs%22&printsec=frontcover síða 82]}} {{tilvitnun|is|lítill=[[hún|Hún]] var … abbadís|margur=[[á|Á]] 12. öld var uppi kona í Þýskalandi og var henni margt til lista lagt. [[hún|Hún]] var guðfræðingur, nunna og abbadís, dulspekingur og prédikari, ljóðskáld og rithöfundur, náttúrufræðingur, lyfjafræðingur, myndlistarmaður og síðast en ekki síst tónskáld. [[hvað|Hvað]] hét þessi fjölhæfa kona?|höf=[[w:Illugi Jökulsson|Jökulsson]]|fhöf=[[w:Illugi Jökulsson|Illugi Jökulsson]]|árið=2021|dag=29. janúar 2021|ftil=„[https://heimildin.is/grein/12819/ 278. spurningaþraut: Stór höf, Rúm eru hættuleg, Noregskóngur og fræg abbadís]“, í ''[[w:Heimildin|Heimildin]]''}} {{s.e.|+=já}} [[biskup]], [[klausturfólk]], [[munkur]], [[nunna]], [[páfi]] # (''staðbundið'') [[óknyttakvendi]], [[harðduglegur|harðdugleg]] kona ====Orðsifjafræði==== Erft úr [[w:norræna|norrænu]] ''[[abbadís#Norræna|abbadís]]'', sem er önnur orðmynd af norrænu ''[[abbatissa#Norræna|abbatissa]]''/''[[abbadissa#Norræna|abbadissa]]''. Samkvæmt Magnússyni (1989) og Schmid (2001) er norræna ''abbatissa'' sjálft annaðhvort: * fengið úr [[w:Fornenska|fornensku]] og [[w:Miðlágþýska|miðlágþýsku]] ''[[abbadisse]]'', fengið úr [[w:Latína|latnesku]] ''[[abbatissa]]''; * fegnið beint úr latnesku ''abbatissa''. {{-þýðingar-}} {{þýðingar |en= {{þýðing|en|abbess}} |fi= {{þýðing|fi|abbedissa}} |grc= {{þýðing|grc|ἡγουμένη}} |fr= {{þýðing|fr|abbesse}} |el= {{þýðing|el|ηγουμένη}} |nl= {{þýðing|nl|abdis}} |it= {{þýðing|it|badessa}}, {{þýðing|it|abadessa}}, {{þýðing|it|abbadessa}} |ca= {{þýðing|ca|abadessa}} |la= {{þýðing|la|abbātissa}} |no= {{þýðing|no|abbedisse}} |pt= {{þýðing|pt|abadessa}} |ro= {{þýðing|ro|egumenă}}, {{þýðing|ro|stareţă}} |ru= {{þýðing|ru|игуменья}}, {{þýðing|ru|аббатиса}}, {{þýðing|ru|настоятельница монастыря}} |es= {{þýðing|es|abadesa}} |sv= {{þýðing|sv|abbedissa}} |de= {{þýðing|de|Äbtissin}} }} {{-tilvísun-}} {{Wikipedia|abbadís}} {{Ref-Orðabók Háskólans|abbad%EDs}} 2re44mhwrzak8ll951w4bwx20qmwcj9 392426 392424 2026-08-29T11:05:14Z Ow! That Hurts! 8952 392426 wikitext text/x-wiki ==Íslenska== {{Fallbeyging kvk sb 01|abbadís}} [[File:Catherine of Sweden (1244) effigy 1905.jpg|thumb|Mynd Katrínar Súnadóttur, einu sinni drottning Svíþjóðar sem gerðist '''abbadís''' eftir að hún varð ekkja, á gröf sinni.]] ===Nafnorð=== '''abbadís''' {{kvk.}}; {{no.s.b.}} # forstöðukona [[nunnuklaustur]]s {{stenst á|is|ábóti}}<!--- ---> {{tilvitnun|is|lítill=að verða abbadís í klaustri nokkru|margur=[[fjellzt|Fjellzt]] hún á þá uppástungu bróðir síns, að verða abbadís í klaustri nokkru, er lá á bakka Rínfljótsins skammt frá kastala föður hennar.|höf=[[w:Steingrímur Thorsteinsson|Thorsteinsson]]|árið=1859|fhöf=[[w:Steingrímur Thorsteinsson|Steingrímur Thorsteinsson]]|dag=1. janúar 1859|ftil=„Hólmgangan“, í ''Ný sumargjöf'', [[w:Kaupmannahöfn|Kaupmannahöfn]]: forlag [[w:Páll Sveinsson|Páls Sveinssonar]], [https://timarit.is/page/2037460?iabr=on síður 8–9]}}<!--- ---> {{tilvitnun|is|lítill=hann læknaði í sumar frakkneska abbadís með kraptaverki.|margur=[[þykir|Þykir]] hann hafa unnið til þess á margan hátt, en sjer [[í lagí]] fyrir það, að hann læknaði í sumar frakkneska abbadís með kraptaverki.|höf=[[w:Björn Jónsson|Jónsson]]|árið=1876|fhöf=[[w:Björn Jónsson|Björn Jónsson]]|dag=28. desember 1876|ftil=„Hitt og þetta“, í ''[[w:Ísafold|Ísafold]]'', 3. árgangur, 31. tölublað, [[w:Reykjavík|Reykjavík]]: Landsprentsmiðjan, [https://timarit.is/page/3939551?iabr=on síða 124]}}<!--- ---> {{tilvitnun|is|lítill=skildi Halldóra abbadís senda menn norður|margur=[[var|Var]] för hans þangað ráðin, og skildi Halldóra abbadís senda menn norður í móti honum um sumarið.|höf=Helgadóttir|árið=1961|fhöf=Guðrún Pálína Helgadóttir|ftil=''Skáldkonur fyrri alda'', Kvöldvökuútgáfan, [https://www.google.com/books/edition/Sk%C3%A1ldkonur_fyrri_alda/nuMuAAAAIAAJ?hl=de&gbpv=1&bsq=%22abbad%C3%ADs%22&dq=%22abbad%C3%ADs%22&printsec=frontcover síða 82]}}<!--- ---> {{tilvitnun|is|lítill=Jeronímus … segir frá að hafi fylgt abbadís sinni í kirkju á sunnudegi|margur=[[hvað|Hvað]] myndi [[t.d.]] gerast með þær nunnur sem Jeronímus í Betlehem segir frá að hafi fylgt abbadís sinni í kirkju á sunnudegi og því næst [[til baka]] til vistarvera sinna og notað það sem eftir var af deginum [[til að]] inna af hendi störf sín við að búa til fatnað annað hvort handa sér eða öðrum?|höf=Snorrason|árið=2016|fhöf=Kenneth Andrew Strand|dag=janúar 1979|ftil=„How Sunday Became the Popular Day of Worship: Part 3 [Hvernig sunnudagur varð vinsæll tilbeiðsludagur: 3. hluti]“, í ''These Times'' [''Þessir tímar''], [https://documents.adventistarchives.org/Periodicals/WM/WM19790101-V88-01.pdf síður 12–15]; þýtt sem “Sunnudagurinn”, í Erling B. Snorrason, ritstjóri, ''Aðventfréttir'', 82. árgangur, 1. tölublað, [[w:Reykjavík|Reykjavík]]: [[w:Kirkja sjöunda dags aðventista|Kirkja sjöunda dags aðventista á Íslandi]], January/February 2016, page 16}}<!--- ---> {{tilvitnun|is|lítill=[[hún|Hún]] var … abbadís|margur=[[á|Á]] 12. öld var uppi kona í Þýskalandi og var henni margt til lista lagt. [[hún|Hún]] var guðfræðingur, nunna og abbadís, dulspekingur og prédikari, ljóðskáld og rithöfundur, náttúrufræðingur, lyfjafræðingur, myndlistarmaður og síðast en ekki síst tónskáld. [[hvað|Hvað]] hét þessi fjölhæfa kona?|höf=[[w:Illugi Jökulsson|Jökulsson]]|fhöf=[[w:Illugi Jökulsson|Illugi Jökulsson]]|árið=2021|dag=29. janúar 2021|ftil=„[https://heimildin.is/grein/12819/ 278. spurningaþraut: Stór höf, Rúm eru hættuleg, Noregskóngur og fræg abbadís]“, í ''[[w:Heimildin|Heimildin]]''}}<!--- ---> {{s.e.|+=já}} [[biskup]], [[klausturfólk]], [[munkur]], [[nunna]], [[páfi]] # (''staðbundið'') [[óknyttakvendi]], [[harðduglegur|harðdugleg]] kona ====Orðsifjafræði==== Erft úr [[w:norræna|norrænu]] ''[[abbadís#Norræna|abbadís]]'', sem er önnur orðmynd af norrænu ''[[abbatissa#Norræna|abbatissa]]''/''[[abbadissa#Norræna|abbadissa]]''. Samkvæmt Magnússyni (1989) og Schmid (2001) er norræna ''abbatissa'' sjálft annaðhvort: * fengið úr [[w:Fornenska|fornensku]] og [[w:Miðlágþýska|miðlágþýsku]] ''[[abbadisse]]'', fengið úr [[w:Latína|latnesku]] ''[[abbatissa]]''; * fegnið beint úr latnesku ''abbatissa''. {{-þýðingar-}} {{þýðingar |en= {{þýðing|en|abbess}} |fi= {{þýðing|fi|abbedissa}} |grc= {{þýðing|grc|ἡγουμένη}} |fr= {{þýðing|fr|abbesse}} |el= {{þýðing|el|ηγουμένη}} |nl= {{þýðing|nl|abdis}} |it= {{þýðing|it|badessa}}, {{þýðing|it|abadessa}}, {{þýðing|it|abbadessa}} |ca= {{þýðing|ca|abadessa}} |la= {{þýðing|la|abbātissa}} |no= {{þýðing|no|abbedisse}} |pt= {{þýðing|pt|abadessa}} |ro= {{þýðing|ro|egumenă}}, {{þýðing|ro|stareţă}} |ru= {{þýðing|ru|игуменья}}, {{þýðing|ru|аббатиса}}, {{þýðing|ru|настоятельница монастыря}} |es= {{þýðing|es|abadesa}} |sv= {{þýðing|sv|abbedissa}} |de= {{þýðing|de|Äbtissin}} }} {{-tilvísun-}} {{Wikipedia|abbadís}} {{Ref-Orðabók Háskólans|abbad%EDs}} eoldmfylkrwiqcmrf4sa18e2lcbuytm 392427 392426 2026-08-29T11:07:22Z Ow! That Hurts! 8952 /* Nafnorð */ 392427 wikitext text/x-wiki ==Íslenska== {{Fallbeyging kvk sb 01|abbadís}} [[File:Catherine of Sweden (1244) effigy 1905.jpg|thumb|Mynd Katrínar Súnadóttur, einu sinni drottning Svíþjóðar sem gerðist '''abbadís''' eftir að hún varð ekkja, á gröf sinni.]] ===Nafnorð=== '''abbadís''' {{kvk.}}; {{no.s.b.}} # forstöðukona [[nunnuklaustur]]s {{stenst á|is|ábóti}}<!--- ---> {{tilvitnun|is|lítill=að verða abbadís í klaustri nokkru|margur=[[fjellzt|Fjellzt]] hún á þá uppástungu bróðir síns, að verða abbadís í klaustri nokkru, er lá á bakka Rínfljótsins skammt frá kastala föður hennar.|höf=[[w:Steingrímur Thorsteinsson|Thorsteinsson]]|árið=1859|fhöf=[[w:Steingrímur Thorsteinsson|Steingrímur Thorsteinsson]]|dag=1. janúar 1859|ftil=„Hólmgangan“, í ''Ný sumargjöf'', [[w:Kaupmannahöfn|Kaupmannahöfn]]: forlag [[w:Páll Sveinsson|Páls Sveinssonar]], [https://timarit.is/page/2037460?iabr=on síður 8–9]}}<!--- ---> {{tilvitnun|is|lítill=hann læknaði í sumar frakkneska abbadís með kraptaverki.|margur=[[þykir|Þykir]] hann hafa unnið til þess á margan hátt, en sjer [[í lagí]] fyrir það, að hann læknaði í sumar frakkneska abbadís með kraptaverki.|höf=[[w:Björn Jónsson|Jónsson]]|árið=1876|fhöf=[[w:Björn Jónsson|Björn Jónsson]]|dag=28. desember 1876|ftil=„Hitt og þetta“, í ''[[w:Ísafold|Ísafold]]'', 3. árgangur, 31. tölublað, [[w:Reykjavík|Reykjavík]]: Landsprentsmiðjan, [https://timarit.is/page/3939551?iabr=on síða 124]}}<!--- ---> {{tilvitnun|is|lítill=skildi Halldóra abbadís senda menn norður|margur=[[var|Var]] för hans þangað ráðin, og skildi Halldóra abbadís senda menn norður í móti honum um sumarið.|höf=Helgadóttir|árið=1961|fhöf=Guðrún Pálína Helgadóttir|ftil=''Skáldkonur fyrri alda'', Kvöldvökuútgáfan, [https://www.google.com/books/edition/Sk%C3%A1ldkonur_fyrri_alda/nuMuAAAAIAAJ?hl=de&gbpv=1&bsq=%22abbad%C3%ADs%22&dq=%22abbad%C3%ADs%22&printsec=frontcover síða 82]}}<!--- ---> {{tilvitnun|is|lítill=Jeronímus … segir frá að hafi fylgt abbadís sinni í kirkju á sunnudegi|margur=[[hvað|Hvað]] myndi [[t.d.]] gerast með þær nunnur sem Jeronímus í Betlehem segir frá að hafi fylgt abbadís sinni í kirkju á sunnudegi og því næst [[til baka]] til vistarvera sinna og notað það sem eftir var af deginum [[til að]] inna af hendi störf sín við að búa til fatnað annað hvort handa sér eða öðrum?|höf=Snorrason|árið=2016|fhöf=Kenneth Andrew Strand|dag=janúar 1979|ftil=„How Sunday Became the Popular Day of Worship: Part 3 [Hvernig sunnudagur varð vinsæll tilbeiðsludagur: 3. hluti]“, í ''These Times'' [''Þessir tímar''], [https://documents.adventistarchives.org/Periodicals/WM/WM19790101-V88-01.pdf síður 12–15]; þýtt sem “Sunnudagurinn”, í Erling B. Snorrason, ritstjóri, ''Aðventfréttir'', 82. árgangur, 1. tölublað, [[w:Reykjavík|Reykjavík]]: [[w:Kirkja sjöunda dags aðventista|Kirkja sjöunda dags aðventista á Íslandi]], janúar/febrúar 2016, [https://timarit.is/page/7356506?iabr=on síða 16]}}<!--- ---> {{tilvitnun|is|lítill=[[hún|Hún]] var … abbadís|margur=[[á|Á]] 12. öld var uppi kona í Þýskalandi og var henni margt til lista lagt. [[hún|Hún]] var guðfræðingur, nunna og abbadís, dulspekingur og prédikari, ljóðskáld og rithöfundur, náttúrufræðingur, lyfjafræðingur, myndlistarmaður og síðast en ekki síst tónskáld. [[hvað|Hvað]] hét þessi fjölhæfa kona?|höf=[[w:Illugi Jökulsson|Jökulsson]]|fhöf=[[w:Illugi Jökulsson|Illugi Jökulsson]]|árið=2021|dag=29. janúar 2021|ftil=„[https://heimildin.is/grein/12819/ 278. spurningaþraut: Stór höf, Rúm eru hættuleg, Noregskóngur og fræg abbadís]“, í ''[[w:Heimildin|Heimildin]]''}}<!--- ---> {{s.e.|+=já}} [[biskup]], [[klausturfólk]], [[munkur]], [[nunna]], [[páfi]] # (''staðbundið'') [[óknyttakvendi]], [[harðduglegur|harðdugleg]] kona ====Orðsifjafræði==== Erft úr [[w:norræna|norrænu]] ''[[abbadís#Norræna|abbadís]]'', sem er önnur orðmynd af norrænu ''[[abbatissa#Norræna|abbatissa]]''/''[[abbadissa#Norræna|abbadissa]]''. Samkvæmt Magnússyni (1989) og Schmid (2001) er norræna ''abbatissa'' sjálft annaðhvort: * fengið úr [[w:Fornenska|fornensku]] og [[w:Miðlágþýska|miðlágþýsku]] ''[[abbadisse]]'', fengið úr [[w:Latína|latnesku]] ''[[abbatissa]]''; * fegnið beint úr latnesku ''abbatissa''. {{-þýðingar-}} {{þýðingar |en= {{þýðing|en|abbess}} |fi= {{þýðing|fi|abbedissa}} |grc= {{þýðing|grc|ἡγουμένη}} |fr= {{þýðing|fr|abbesse}} |el= {{þýðing|el|ηγουμένη}} |nl= {{þýðing|nl|abdis}} |it= {{þýðing|it|badessa}}, {{þýðing|it|abadessa}}, {{þýðing|it|abbadessa}} |ca= {{þýðing|ca|abadessa}} |la= {{þýðing|la|abbātissa}} |no= {{þýðing|no|abbedisse}} |pt= {{þýðing|pt|abadessa}} |ro= {{þýðing|ro|egumenă}}, {{þýðing|ro|stareţă}} |ru= {{þýðing|ru|игуменья}}, {{þýðing|ru|аббатиса}}, {{þýðing|ru|настоятельница монастыря}} |es= {{þýðing|es|abadesa}} |sv= {{þýðing|sv|abbedissa}} |de= {{þýðing|de|Äbtissin}} }} {{-tilvísun-}} {{Wikipedia|abbadís}} {{Ref-Orðabók Háskólans|abbad%EDs}} 2nc8z1pdb46y8piywymrbc6xcjqoksf 392428 392427 2026-08-29T11:07:57Z Ow! That Hurts! 8952 /* Nafnorð */ 392428 wikitext text/x-wiki ==Íslenska== {{Fallbeyging kvk sb 01|abbadís}} [[File:Catherine of Sweden (1244) effigy 1905.jpg|thumb|Mynd Katrínar Súnadóttur, einu sinni drottning Svíþjóðar sem gerðist '''abbadís''' eftir að hún varð ekkja, á gröf sinni.]] ===Nafnorð=== '''abbadís''' {{kvk.}}; {{no.s.b.}} # forstöðukona [[nunnuklaustur]]s {{stenst á|is|ábóti}}<!--- ---> {{tilvitnun|is|lítill=að verða abbadís í klaustri nokkru|margur=[[fjellzt|Fjellzt]] hún á þá uppástungu bróðir síns, að verða abbadís í klaustri nokkru, er lá á bakka Rínfljótsins skammt frá kastala föður hennar.|höf=[[w:Steingrímur Thorsteinsson|Thorsteinsson]]|árið=1859|fhöf=[[w:Steingrímur Thorsteinsson|Steingrímur Thorsteinsson]]|dag=1. janúar 1859|ftil=„Hólmgangan“, í ''Ný sumargjöf'', [[w:Kaupmannahöfn|Kaupmannahöfn]]: forlag [[w:Páll Sveinsson|Páls Sveinssonar]], [https://timarit.is/page/2037460?iabr=on síður 8–9]}}<!--- ---> {{tilvitnun|is|lítill=hann læknaði í sumar frakkneska abbadís með kraptaverki.|margur=[[þykir|Þykir]] hann hafa unnið til þess á margan hátt, en sjer [[í lagí]] fyrir það, að hann læknaði í sumar frakkneska abbadís með kraptaverki.|höf=[[w:Björn Jónsson|Jónsson]]|árið=1876|fhöf=[[w:Björn Jónsson|Björn Jónsson]]|dag=28. desember 1876|ftil=„Hitt og þetta“, í ''[[w:Ísafold|Ísafold]]'', 3. árgangur, 31. tölublað, [[w:Reykjavík|Reykjavík]]: Landsprentsmiðjan, [https://timarit.is/page/3939551?iabr=on síða 124]}}<!--- ---> {{tilvitnun|is|lítill=skildi Halldóra abbadís senda menn norður|margur=[[var|Var]] för hans þangað ráðin, og skildi Halldóra abbadís senda menn norður í móti honum um sumarið.|höf=Helgadóttir|árið=1961|fhöf=Guðrún Pálína Helgadóttir|ftil=''Skáldkonur fyrri alda'', Kvöldvökuútgáfan, [https://www.google.com/books/edition/Sk%C3%A1ldkonur_fyrri_alda/nuMuAAAAIAAJ?hl=de&gbpv=1&bsq=%22abbad%C3%ADs%22&dq=%22abbad%C3%ADs%22&printsec=frontcover síða 82]}}<!--- ---> {{tilvitnun|is|lítill=Jeronímus … segir frá að hafi fylgt abbadís sinni í kirkju á sunnudegi|margur=[[hvað|Hvað]] myndi [[t.d.]] gerast með þær nunnur sem Jeronímus í Betlehem segir frá að hafi fylgt abbadís sinni í kirkju á sunnudegi og því næst [[til baka]] til vistarvera sinna og notað það sem eftir var af deginum [[til að]] inna af hendi störf sín við að búa til fatnað annað hvort handa sér eða öðrum?|höf=Snorrason|árið=2016|fhöf=Kenneth Andrew Strand|dag=janúar 1979|ftil=„How Sunday Became the Popular Day of Worship: Part 3 [Hvernig sunnudagur varð vinsæll tilbeiðsludagur: 3. hluti]“, í ''These Times'' [''Þessir tímar''], [https://documents.adventistarchives.org/Periodicals/WM/WM19790101-V88-01.pdf síður 12–15]; þýtt sem “Sunnudagurinn”, í {{hástafir|Erling B. Snorrason}}, ritstjóri, ''Aðventfréttir'', 82. árgangur, 1. tölublað, [[w:Reykjavík|Reykjavík]]: [[w:Kirkja sjöunda dags aðventista|Kirkja sjöunda dags aðventista á Íslandi]], janúar/febrúar 2016, [https://timarit.is/page/7356506?iabr=on síða 16]}}<!--- ---> {{tilvitnun|is|lítill=[[hún|Hún]] var … abbadís|margur=[[á|Á]] 12. öld var uppi kona í Þýskalandi og var henni margt til lista lagt. [[hún|Hún]] var guðfræðingur, nunna og abbadís, dulspekingur og prédikari, ljóðskáld og rithöfundur, náttúrufræðingur, lyfjafræðingur, myndlistarmaður og síðast en ekki síst tónskáld. [[hvað|Hvað]] hét þessi fjölhæfa kona?|höf=[[w:Illugi Jökulsson|Jökulsson]]|fhöf=[[w:Illugi Jökulsson|Illugi Jökulsson]]|árið=2021|dag=29. janúar 2021|ftil=„[https://heimildin.is/grein/12819/ 278. spurningaþraut: Stór höf, Rúm eru hættuleg, Noregskóngur og fræg abbadís]“, í ''[[w:Heimildin|Heimildin]]''}}<!--- ---> {{s.e.|+=já}} [[biskup]], [[klausturfólk]], [[munkur]], [[nunna]], [[páfi]] # (''staðbundið'') [[óknyttakvendi]], [[harðduglegur|harðdugleg]] kona ====Orðsifjafræði==== Erft úr [[w:norræna|norrænu]] ''[[abbadís#Norræna|abbadís]]'', sem er önnur orðmynd af norrænu ''[[abbatissa#Norræna|abbatissa]]''/''[[abbadissa#Norræna|abbadissa]]''. Samkvæmt Magnússyni (1989) og Schmid (2001) er norræna ''abbatissa'' sjálft annaðhvort: * fengið úr [[w:Fornenska|fornensku]] og [[w:Miðlágþýska|miðlágþýsku]] ''[[abbadisse]]'', fengið úr [[w:Latína|latnesku]] ''[[abbatissa]]''; * fegnið beint úr latnesku ''abbatissa''. {{-þýðingar-}} {{þýðingar |en= {{þýðing|en|abbess}} |fi= {{þýðing|fi|abbedissa}} |grc= {{þýðing|grc|ἡγουμένη}} |fr= {{þýðing|fr|abbesse}} |el= {{þýðing|el|ηγουμένη}} |nl= {{þýðing|nl|abdis}} |it= {{þýðing|it|badessa}}, {{þýðing|it|abadessa}}, {{þýðing|it|abbadessa}} |ca= {{þýðing|ca|abadessa}} |la= {{þýðing|la|abbātissa}} |no= {{þýðing|no|abbedisse}} |pt= {{þýðing|pt|abadessa}} |ro= {{þýðing|ro|egumenă}}, {{þýðing|ro|stareţă}} |ru= {{þýðing|ru|игуменья}}, {{þýðing|ru|аббатиса}}, {{þýðing|ru|настоятельница монастыря}} |es= {{þýðing|es|abadesa}} |sv= {{þýðing|sv|abbedissa}} |de= {{þýðing|de|Äbtissin}} }} {{-tilvísun-}} {{Wikipedia|abbadís}} {{Ref-Orðabók Háskólans|abbad%EDs}} kq41140wvldruh2tfwr53c5jegi7kmc Snið:s.e. 10 118909 392342 2026-08-29T01:42:39Z Ow! That Hurts! 8952 Bjó til síðu með „''sjá einnig:''“ 392342 wikitext text/x-wiki ''sjá einnig:'' cg4yndmg9rz6uykxtrboen8tt7qgkqd 392343 392342 2026-08-29T01:46:27Z Ow! That Hurts! 8952 392343 wikitext text/x-wiki {{#if:{{{+|}}}|→ }}''sjá einnig:''<noinclude> ===Dæmi=== # <code><nowiki>{{s.e.}}</nowiki></code> #: {{s.e.}} # <code><nowiki>{{s.e.|+=já}}</nowiki></code> #: {{s.e.|+=já}} </noinclude> t49nyedt52pi9rfaz1o928o8zqem071 Module:tilvitnun 828 118910 392344 2026-08-29T02:28:23Z Ow! That Hurts! 8952 vibe coded 392344 Scribunto text/plain local p = {} function p.main(frame) local args = frame:getParent().args local result = {} -- Assuming parameter 1 is passed as a positional or named argument local base1 = args[1] or "" -- Loop through potential numbered parameters (e.g., 2, 3, 4...) -- We can check up to a safe maximum or dynamically find them local i = 2 while true do local val = args[tostring(i)] local val_b = args[i .. 'b'] or val local f_val = args['f' .. i] local e_val = args['e' .. i] if not val then -- Break if val doesn't exist. If you have sparse indices, -- you might want a fixed cap instead (e.g., i <= 20) break end local item = "" if f_val and f_val ~= "" then item = item .. "{{litur|#999999|" .. f_val .. "}}" end item = item .. "[[" .. val .. "#" .. mw.ustring.upper(base1) .. "|" .. "{{litur|#999999|" .. val_b .. "}}" .. "]]" if e_val and e_val ~= "" then item = item .. "{{litur|#999999|" + e_val .. "}}" end table.insert(result, item) i = i + 1 end return table.concat(result, " ") end return p kup3l9rwqt1ijk73m4vze21y27kncyo 392345 392344 2026-08-29T02:31:54Z Ow! That Hurts! 8952 392345 Scribunto text/plain local p = {} function p.main(frame) local args = frame:getParent().args local result = {} -- Assuming parameter 1 is passed as a positional or named argument local base1 = args[1] or "" -- Loop through potential numbered parameters (e.g., 2, 3, 4...) -- We can check up to a safe maximum or dynamically find them local i = 2 while true do local val = args[tostring(i)] local val_b = args[i .. 'b'] or val local f_val = args['f' .. i] local e_val = args['e' .. i] if not val then -- Break if val doesn't exist. If you have sparse indices, -- you might want a fixed cap instead (e.g., i <= 20) break end local item = "" if f_val and f_val ~= "" then item = item .. "{{litur|#999999|" .. f_val .. "}}" end item = item .. "[[" .. val .. "#" .. mw.ustring.upper(base1) .. "|" .. "{{litur|#999999|" .. val_b .. "}}" .. "]]" if e_val and e_val ~= "" then item = item .. "{{litur|#999999|" .. e_val .. "}}" end table.insert(result, item) i = i + 1 end return table.concat(result, " ") end return p g5nixmumqklf9hasshgkc7bqm6no91f 392346 392345 2026-08-29T02:34:00Z Ow! That Hurts! 8952 392346 Scribunto text/plain local p = {} function p.main(frame) local args = frame:getParent().args local result = {} local base1 = args[1] or "" -- Loop through a safe maximum range (e.g., up to 20) to prevent gaps from breaking it for i = 2, 20 do local val = args[tostring(i)] if val and val ~= "" then local val_b = args[i .. 'b'] or val local f_val = args['f' .. i] local e_val = args['e' .. i] local item = "" if f_val and f_val ~= "" then item = item .. "{{litur|#999999|" .. f_val .. "}}" end item = item .. "[[" .. val .. "#" .. mw.ustring.upper(base1) .. "|" .. "{{litur|#999999|" .. val_b .. "}}" .. "]]" if e_val and e_val ~= "" then item = item .. "{{litur|#999999|" .. e_val .. "}}" end table.insert(result, item) end end local finalString = table.concat(result, " ") -- This preprocess step forces MediaWiki to parse the templates instead of printing code text return frame:preprocess(finalString) end return p 079ly5u0n4936ijbg3xp2u1zhulv4il 392347 392346 2026-08-29T02:36:23Z Ow! That Hurts! 8952 392347 Scribunto text/plain local p = {} function p.main(frame) -- frame:getParent().args fetches arguments passed to the template *holding* the invoke local args = frame:getParent().args local result = {} local base1 = args[1] or "" for i = 2, 20 do local val = args[tostring(i)] if val and val ~= "" then local val_b = args[i .. 'b'] or val local f_val = args['f' .. i] local e_val = args['e' .. i] local item = "" if f_val and f_val ~= "" then item = item .. "{{litur|#999999|" .. f_val .. "}}" end item = item .. "[[" .. val .. "#" .. mw.ustring.upper(base1) .. "|" .. "{{litur|#999999|" .. val_b .. "}}" .. "]]" if e_val and e_val ~= "" then item = item .. "{{litur|#999999|" .. e_val .. "}}" end table.insert(result, item) end end local finalString = table.concat(result, " ") return frame:preprocess(finalString) end return p al13osemu9pvhh5lf3i98g2mw037jd0 392348 392347 2026-08-29T02:38:40Z Ow! That Hurts! 8952 392348 Scribunto text/plain local p = {} function p.main(frame) -- Grab parent arguments if available, fall back to direct args local args = frame:getParent().args if not next(args) then args = frame.args end local base1 = args[1] or "" local result = {} -- Loop dynamically from 2 up to 30 to catch all potential items for i = 2, 30 do local val = args[tostring(i)] -- If the parameter exists and is not an empty string if val and val ~= "" then local val_b = args[i .. 'b'] or val local f_val = args['f' .. i] local e_val = args['e' .. i] local item = "" if f_val and f_val ~= "" then item = item .. "{{litur|#999999|" .. f_val .. "}}" end item = item .. "[[" .. val .. "#" .. mw.ustring.upper(base1) .. "|" .. "{{litur|#999999|" .. val_b .. "}}" .. "]]" if e_val and e_val ~= "" then item = item .. "{{litur|#999999|" .. e_val .. "}}" end table.insert(result, item) end end if #result == 0 then return "" end return frame:preprocess(table.concat(result, " ")) end return p 765am5plal27yexdlefmu1gkz79w1ai 392349 392348 2026-08-29T02:40:40Z Ow! That Hurts! 8952 392349 Scribunto text/plain local p = {} function p.main(frame) local args = frame:getParent().args if not next(args) then args = frame.args end local base1 = args[1] or "" local result = {} -- Loop through indices 2 up to 20 for i = 2, 20 do local key = tostring(i) local val = args[key] -- Trim whitespace if val exists if val then val = mw.text.trim(val) end if val and val ~= "" then local val_b = args[i .. 'b'] if val_b then val_b = mw.text.trim(val_b) end if not val_b or val_b == "" then val_b = val end local f_val = args['f' .. i] if f_val then f_val = mw.text.trim(f_val) end local e_val = args['e' .. i] if e_val then e_val = mw.text.trim(e_val) end local item = "" if f_val and f_val ~= "" then item = item .. "{{litur|#999999|" .. f_val .. "}}" end item = item .. "[[" .. val .. "#" .. mw.ustring.upper(base1) .. "|" .. "{{litur|#999999|" .. val_b .. "}}" .. "]]" if e_val and e_val ~= "" then item = item .. "{{litur|#999999|" .. e_val .. "}}" end table.insert(result, item) end end if #result == 0 then return "" end return frame:preprocess(table.concat(result, " ")) end return p jmz0j87dsgpb3wsozeujtmzx09pia2b 392351 392349 2026-08-29T02:45:51Z Ow! That Hurts! 8952 392351 Scribunto text/plain local p = {} function p.main(frame) local args = frame:getParent().args if not next(args) then args = frame.args end local base1 = args[1] or "" local result = {} for i = 2, 20 do local val = args[tostring(i)] if val then val = mw.text.trim(val) end if val and val ~= "" then local val_b = args[i .. 'b'] if val_b then val_b = mw.text.trim(val_b) end if not val_b or val_b == "" then val_b = val end local f_val = args['f' .. i] if f_val then f_val = mw.text.trim(f_val) end local e_val = args['e' .. i] if e_val then e_val = mw.text.trim(e_val) end local item = "" if f_val and f_val ~= "" then item = item .. "{{litur|#999999|" .. f_val .. "}}" end item = item .. "[[" .. val .. "#" .. mw.ustring.upper(base1) .. "|" .. "{{litur|#999999|" .. val_b .. "}}" .. "]]" if e_val and e_val ~= "" then item = item .. "{{litur|#999999|" .. e_val .. "}}" end table.insert(result, item) end end if #result == 0 then return "" end return frame:preprocess(table.concat(result, " ")) end return p 4hggdnba259s0uzylmcn1cpd5olzroe 392353 392351 2026-08-29T03:19:56Z Ow! That Hurts! 8952 392353 Scribunto text/plain local p = {} function p.main(frame) local args = frame:getParent().args local langCode = args[1] or "" local ucLangCode = mw.ustring.upper(langCode) local parts = {} -- Handle the initial bullet point if 'enginn depill' is not set if (args["enginn depill"] or "") == "" then table.insert(parts, "{{litur|#999999|• }}") end -- Loop from index 2 to 12 for i = 2, 12 do local target = args[tostring(i)] -- Only process the row if the main target parameter exists if target and target ~= "" then local fVal = args["f" .. i] local eVal = args["e" .. i] local displayVal = args[i .. "b"] or target local rowString = "" if fVal and fVal ~= "" then rowString = rowString .. "{{litur|#999999|" .. fVal .. "}}" end rowString = rowString .. "[[" .. target .."#" .. ucLangCode .. "|" .. "{{litur|#999999|" .. displayVal .. "}}" .. "]]" if eVal and eVal ~= "" then rowString = rowString .. "{{litur|#999999|" .. eVal .. "}}" end table.insert(parts, rowString) end end -- Join everything together with an empty string so there are no rogue spaces or newlines local result = table.concat(parts, "") -- Pass through frame:preprocess so templates like {{litur}} expand correctly return frame:preprocess(result) end return p o2owwgirv8xe06piwmsiqcwp0i0h8ez 392354 392353 2026-08-29T03:22:25Z Ow! That Hurts! 8952 392354 Scribunto text/plain local p = {} function p.main(frame) local args = frame:getParent().args local langCode = args[1] or "" local ucLangCode = mw.ustring.upper(langCode) local parts = {} -- Handle the initial bullet point if 'enginn depill' is not set if (args["enginn depill"] or "") == "" then table.insert(parts, "{{litur|#999999|• }}") end -- Loop from index 2 to 12 for i = 2, 12 do local target = args[tostring(i)] -- Only process the row if the main target parameter exists if target and target ~= "" then local fVal = args["f" .. i] local eVal = args["e" .. i] local displayVal = args[i .. "b"] or target local rowString = "" if fVal and fVal ~= "" then rowString = rowString .. "{{litur|#999999|" .. fVal .. "}}" end rowString = rowString .. "[[" .. target .."#" .. ucLangCode .. "|" .. "{{litur|#999999|" .. displayVal .. "}}" .. "]]" if eVal and eVal ~= "" then rowString = rowString .. "{{litur|#999999|" .. eVal .. "}}" end table.insert(parts, rowString) end end -- Join everything together with an empty string so there are no rogue spaces or newlines local result = table.concat(parts, " ") -- Pass through frame:preprocess so templates like {{litur}} expand correctly return frame:preprocess(result) end return p ea4p1a5zngtpzjo5os4lplli388bebr 392355 392354 2026-08-29T03:25:24Z Ow! That Hurts! 8952 392355 Scribunto text/plain local p = {} function p.main(frame) local args = frame:getParent().args local langCode = args[1] or "" local ucLangCode = mw.ustring.upper(langCode) local parts = {} -- Loop from index 2 to 12 local i = 2 while true do local target = args[tostring(i)] -- Stop the loop when there are no more target parameters if not target or target == "" then break end local fVal = args["f" .. i] local eVal = args["e" .. i] local displayVal = args[i .. "b"] or target local rowString = "" if fVal and fVal ~= "" then rowString = rowString .. "{{litur|#999999|" .. fVal .. "}}" end rowString = rowString .. "[[" .. target .."#" .. ucLangCode .. "|" .. "{{litur|#999999|" .. displayVal .. "}}" .. "]]" if eVal and eVal ~= "" then rowString = rowString .. "{{litur|#999999|" .. eVal .. "}}" end table.insert(parts, rowString) i = i + 1 end -- Join everything together with a space local result = table.concat(parts, " ") -- Pass through frame:preprocess so templates like {{litur}} expand correctly return frame:preprocess(result) end return p 7l2ovy2abr7gnw55oc4z8tpym1nazvw 392356 392355 2026-08-29T03:27:45Z Ow! That Hurts! 8952 392356 Scribunto text/plain local p = {} function p.main(frame) local args = frame:getParent().args local langCode = args[1] or "" local ucLangCode = mw.ustring.upper(langCode) local parts = {} -- Handle the initial bullet point if 'enginn depill' is not set if (args["enginn depill"] or "") == "" then table.insert(parts, "{{litur|#999999|• }}") end -- Loop from index 2 to 12 local i = 2 while true do local target = args[tostring(i)] -- Stop the loop when there are no more target parameters if not target or target == "" then break end local fVal = args["f" .. i] local eVal = args["e" .. i] local displayVal = args[i .. "b"] or target local rowString = "" if fVal and fVal ~= "" then rowString = rowString .. "{{litur|#999999|" .. fVal .. "}}" end rowString = rowString .. "[[" .. target .."#" .. ucLangCode .. "|" .. "{{litur|#999999|" .. displayVal .. "}}" .. "]]" if eVal and eVal ~= "" then rowString = rowString .. "{{litur|#999999|" .. eVal .. "}}" end table.insert(parts, rowString) i = i + 1 end -- Join everything together with a space local result = table.concat(parts, " ") -- Pass through frame:preprocess so templates like {{litur}} expand correctly return frame:preprocess(result) end return p 1uu80q447uu4u77zn777rugskv6uegg 392357 392356 2026-08-29T03:31:28Z Ow! That Hurts! 8952 392357 Scribunto text/plain local p = {} function p.main(frame) local args = frame:getParent().args -- Fallback to current args if called directly via #invoke with parameters if not args[1] and frame.args[1] then args = frame.args end local langCode = args[1] or "" local ucLangCode = mw.ustring.upper(langCode) local parts = {} -- Handle initial bullet point if 'enginn depill' is blank if (args["enginn depill"] or "") == "" then table.insert(parts, "{{litur|#999999|• }}") end -- Loop through parameters 2 to 12 for i = 2, 12 do local target = args[tostring(i)] if target and target ~= "" then local fVal = args["f" .. i] local eVal = args["e" .. i] local displayVal = args[i .. "b"] or target local rowParts = {} if fVal and fVal ~= "" then table.insert(rowParts, "{{litur|#999999|" .. fVal .. "}}") end table.insert(rowParts, "[[" .. target .. "#" .. ucLangCode .. "|" .. "{{litur|#999999|" .. displayVal .. "}}" .. "]]") if eVal and eVal ~= "" then table.insert(rowParts, "{{litur|#999999|" .. eVal .. "}}") end -- Concatenate elements of this specific row tightly table.insert(parts, table.concat(rowParts, "")) end end -- Join all rows together with an empty string so no rogue line breaks exist local result = table.concat(parts, "") -- Preprocess parses templates like {{litur}} and internal links properly result = frame:preprocess(result) -- Clean up any residual newline characters generated by templates result = mw.text.trim(result) result = string.gsub(result, "[\r\n]+", " ") return result end return p jr5mnn8rlwtj9x1gqr70fbgs62qnrmf 392358 392357 2026-08-29T03:33:00Z Ow! That Hurts! 8952 Afturkallaði útgáfu [[Special:Diff/392357|392357]] frá [[Special:Contributions/Ow! That Hurts!|Ow! That Hurts!]] ([[User talk:Ow! That Hurts!|spjall]]) 392358 Scribunto text/plain local p = {} function p.main(frame) local args = frame:getParent().args local langCode = args[1] or "" local ucLangCode = mw.ustring.upper(langCode) local parts = {} -- Handle the initial bullet point if 'enginn depill' is not set if (args["enginn depill"] or "") == "" then table.insert(parts, "{{litur|#999999|• }}") end -- Loop from index 2 to 12 local i = 2 while true do local target = args[tostring(i)] -- Stop the loop when there are no more target parameters if not target or target == "" then break end local fVal = args["f" .. i] local eVal = args["e" .. i] local displayVal = args[i .. "b"] or target local rowString = "" if fVal and fVal ~= "" then rowString = rowString .. "{{litur|#999999|" .. fVal .. "}}" end rowString = rowString .. "[[" .. target .."#" .. ucLangCode .. "|" .. "{{litur|#999999|" .. displayVal .. "}}" .. "]]" if eVal and eVal ~= "" then rowString = rowString .. "{{litur|#999999|" .. eVal .. "}}" end table.insert(parts, rowString) i = i + 1 end -- Join everything together with a space local result = table.concat(parts, " ") -- Pass through frame:preprocess so templates like {{litur}} expand correctly return frame:preprocess(result) end return p 1uu80q447uu4u77zn777rugskv6uegg 392359 392358 2026-08-29T03:37:06Z Ow! That Hurts! 8952 392359 Scribunto text/plain local p = {} function p.main(frame) local args = frame:getParent().args local langCode = args[1] or "" local ucLangCode = mw.ustring.upper(langCode) local parts = {} -- Handle the initial bullet point if 'enginn depill' is not set if (args["enginn depill"] or "") == "" then table.insert(parts, "{{litur|#999999|• }}") end -- Loop from index 2 to 12 local i = 2 while true do local target = args[tostring(i)] -- Stop the loop when there are no more target parameters if not target or target == "" then break end local fVal = args["f" .. i] local eVal = args["e" .. i] local displayVal = args[i .. "b"] or target local rowString = "" if fVal and fVal ~= "" then rowString = rowString .. "{{litur|#999999|" .. fVal .. "}}" end rowString = rowString .. "[[" .. target .."#" .. ucLangCode .. "|" .. "{{litur|#999999|" .. displayVal .. "}}" .. "]]" if eVal and eVal ~= "" then rowString = rowString .. "{{litur|#999999|" .. eVal .. "}}" end table.insert(parts, rowString) i = i + 1 end -- Join everything together with a space local result = table.concat(parts, " ") return frame:preprocess(mw.text.trim(result)) end return p l9xtulb7n1xl9cja0doiji4xz0amj8k 392360 392359 2026-08-29T03:42:33Z Ow! That Hurts! 8952 392360 Scribunto text/plain local p = {} function p.main(frame) local args = frame:getParent().args local langCode = args[1] or "" local ucLangCode = mw.ustring.upper(langCode) local parts = {} if (args["enginn depill"] or "") == "" then table.insert(parts, "{{litur|#999999|• }}") end local i = 2 while true do local rawInput = args[tostring(i)] if not rawInput or rawInput == "" then break end -- Extract custom inline tags if present: <b:...>, <f:...>, <e:...> -- If no <b:...> is provided, fallback to the rawInput text itself local displayVal = mw.ustring.match(rawInput, "<b:([^>]+)>") or rawInput local fVal = mw.ustring.match(rawInput, "<f:([^>]+)>") local eVal = mw.ustring.match(rawInput, "<e:([^>]+)>") -- Clean the target link by stripping out the inline tags so the URL points to the right page local target = mw.ustring.gsub(rawInput, "<[bef]:[^>]+>", "") local rowString = "" if fVal and fVal ~= "" then rowString = rowString .. "{{litur|#999999|" .. fVal .. "}}" end rowString = rowString .. "[[" .. target .. "#" .. ucLangCode .. "|" .. "{{litur|#999999|" .. displayVal .. "}}" .. "]]" if eVal and eVal ~= "" then rowString = rowString .. "{{litur|#999999|" .. eVal .. "}}" end table.insert(parts, rowString) i = i + 1 end local result = table.concat(parts, " ") return frame:preprocess(mw.text.trim(result)) end return p g7qywltts9v9q86h74f1miyfauindia 392361 392360 2026-08-29T03:44:20Z Ow! That Hurts! 8952 392361 Scribunto text/plain local p = {} function p.main(frame) local args = frame:getParent().args local langCode = args[1] or "" local ucLangCode = mw.ustring.upper(langCode) local parts = {} if (args["enginn depill"] or "") == "" then table.insert(parts, "{{litur|#999999|• }}") end local i = 2 while true do local rawInput = args[tostring(i)] if not rawInput or rawInput == "" then break end -- Extract inline tags: <b:...>, <f:...>, <e:...> local displayVal = mw.ustring.match(rawInput, "<b:([^>]+)>") or rawInput local fVal = mw.ustring.match(rawInput, "<f:([^>]+)>") local eVal = mw.ustring.match(rawInput, "<e:([^>]+)>") -- Clean the target link by stripping out all <...> tags local target = mw.ustring.gsub(rawInput, "<[^>]+>", "") local rowString = "" if fVal and fVal ~= "" then rowString = rowString .. "{{litur|#999999|" .. fVal .. "}}" end rowString = rowString .. "[[" .. target .. "#" .. ucLangCode .. "|" .. "{{litur|#999999|" .. displayVal .. "}}" .. "]]" if eVal and eVal ~= "" then rowString = rowString .. "{{litur|#999999|" .. eVal .. "}}" end table.insert(parts, rowString) i = i + 1 end local result = table.concat(parts, " ") return frame:preprocess(mw.text.trim(result)) end return p otlay92jutx7lveekneyugcuf870i9t 392362 392361 2026-08-29T03:56:44Z Ow! That Hurts! 8952 392362 Scribunto text/plain local p = {} function p.main(frame) local args = frame:getParent().args local text = args[1] or "" if text == "" then return "" end -- Tracks occurrence counts for each word to support duplicate differentiation (Requirement 3.5) local wordCounts = {} local tokens = {} -- Tokenize text into words, punctuation, and whitespace using UTF-8 safe patterns for token in mw.ustring.gmatch(text, "[%a\194-\244\128-\191]+|[%p]+|%s+") do if mw.ustring.match(token, "[%a\194-\244\128-\191]") then -- Increment occurrence index for duplicate tracking wordCounts[token] = (wordCounts[token] or 0) + 1 local index = wordCounts[token] -- Check parameters in order of specificity: -- 1. Specific instance override (e.g., "Ég_1") -- 2. General word override (e.g., "Ég") -- 3. Default to the surface token text local target = args[token .. "_" .. index] or args[token] or token -- Wrap the link text in a span to force #999999 color local formatted = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, token) table.insert(tokens, formatted) elseif mw.ustring.match(token, "[%p]") then -- Punctuation styled and linked to itself to satisfy strict link requirements local formatted = string.format('[[%s|<span style="color:#999999;">%s</span>]]', token, token) table.insert(tokens, formatted) else -- Preserve whitespace as-is table.insert(tokens, token) end end return table.concat(tokens) end return p lkawi3tuazsxtxlxl5c5909ox3weowl 392363 392362 2026-08-29T03:58:07Z Ow! That Hurts! 8952 392363 Scribunto text/plain local p = {} function p.main(frame) local args = frame:getParent().args local text = args[1] or "" if text == "" then return "" end local wordCounts = {} local tokens = {} -- Use standard string.gmatch with a robust pattern that captures -- UTF-8 multibyte characters safely without throwing non-UTF8 exceptions. -- This matches sequences of letters (including Icelandic extended characters), -- punctuation blocks, and whitespace/newlines. local pattern = "([%z\1-\127\194-\244][\128-\191]*)+|(%s+)" -- Alternatively, iterate character/token blocks safely: for word, space in string.gmatch(text, "([%z\1-\127\194-\244][\128-\191]*-%a*|[%a\192-\255]+[%a\192-\255%p]*|[%p]+|%s+)") do if space and space ~= "" then table.insert(tokens, space) elseif word and word ~= "" then -- Check if it's punctuation or a word if mw.ustring.match(word, "^[%p]+$") then local formatted = string.format('[[%s|<span style="color:#999999;">%s</span>]]', word, word) table.insert(tokens, formatted) else wordCounts[word] = (wordCounts[word] or 0) + 1 local index = wordCounts[word] local target = args[word .. "_" .. index] or args[word] or word local formatted = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, word) table.insert(tokens, formatted) end end end return table.concat(tokens) end return p shajt3osyh6gdqkcbsl3wt1qx9ckr0f 392364 392363 2026-08-29T03:59:01Z Ow! That Hurts! 8952 392364 Scribunto text/plain local p = {} function p.main(frame) local args = frame:getParent().args local text = args[1] or "" if text == "" then return "" end local wordCounts = {} local tokens = {} -- Safe byte-level pattern matching to tokenise words, punctuation, and spaces -- without failing MediaWiki's strict ustring UTF-8 input filters. for word, punct, space in string.gmatch(text, "([%a%z\128-\255]+)|([%p]+)|(%s+)") do if space and space ~= "" then table.insert(tokens, space) elseif punct and punct ~= "" then local formatted = string.format('[[%s|<span style="color:#999999;">%s</span>]]', punct, punct) table.insert(tokens, formatted) elseif word and word ~= "" then wordCounts[word] = (wordCounts[word] or 0) + 1 local index = wordCounts[word] local target = args[word .. "_" .. index] or args[word] or word local formatted = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, word) table.insert(tokens, formatted) end end return table.concat(tokens) end return p hjbm6zorrv00f755o8re685e7iigmhd 392365 392364 2026-08-29T04:01:26Z Ow! That Hurts! 8952 392365 Scribunto text/plain local p = {} function p.main(frame) local args = frame:getParent().args local text = args[1] or "" if text == "" then return "" end local wordCounts = {} local tokens = {} -- Use mw.text.gsplit or simple whitespace-based/character iteration safely, -- or iterate chunks using standard string patterns that match any non-empty sequence. -- To guarantee it renders without blanking out, we match chunks of non-space characters vs spaces. for chunk in string.gmatch(text, "%S+%s*") do -- Separate the word/punctuation part from trailing whitespace local word, space = string.match(chunk, "^(%S+)(%s*)$") if word then -- Check if the token is purely punctuation if mw.ustring.match(word, "^[%p]+$") then local formatted = string.format('[[%s|<span style="color:#999999;">%s</span>]]', word, word) table.insert(tokens, formatted) else -- Count word occurrences for duplicate parameters (Requirement 3.5) wordCounts[word] = (wordCounts[word] or 0) + 1 local index = wordCounts[word] -- Target fallback order: specific instance -> general word -> original word local target = args[word .. "_" .. index] or args[word] or word local formatted = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, word) table.insert(tokens, formatted) end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end return p o7sportou8m8fl7smw1rehloz6vd3of 392366 392365 2026-08-29T04:10:13Z Ow! That Hurts! 8952 392366 Scribunto text/plain local p = {} function p.main(frame) local args = frame:getParent().args local text = args[1] or "" if text == "" then return "" end local wordCounts = {} local tokens = {} for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then -- Check if the token is purely punctuation if mw.ustring.match(token, "^[%p]+$") then table.insert(tokens, token) else -- Separate attached punctuation from the core word (e.g., "word," -> word and ,) local coreWord, punct = mw.ustring.match(token, "^(.-)([%p]+)$") if not coreWord or coreWord == "" then coreWord = token punct = "" end -- Count core word occurrences for duplicate parameters (Requirement 3.5) wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] -- Target fallback order for the link local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord -- Check if user requested punctuation inside the link via parameter (e.g., word_punct = já or word_1_punct = já) local includePunct = (args[coreWord .. "_" .. index .. "_punct"] == "já") or (args[coreWord .. "_punct"] == "já") local formatted if punct ~= "" and includePunct then -- Include punctuation inside the link wrapper formatted = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord .. punct) elseif punct ~= "" then -- Link only the word, leave punctuation outside and styled #999999 formatted = string.format('[[%s|<span style="color:#999999;">%s</span>]]<span style="color:#999999;">%s</span>', target, coreWord, punct) else -- Standard word with no punctuation attached formatted = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end table.insert(tokens, formatted) end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end return p 2dszfercftpnep69f7hpvh9apavx1g3 392367 392366 2026-08-29T04:14:25Z Ow! That Hurts! 8952 392367 Scribunto text/plain local p = {} function p.main(frame) local args = frame:getParent().args local text = args[1] or "" if text == "" then return "" end local wordCounts = {} local tokens = {} -- Match chunks, preserving pre-existing explicit wikilinks [[target|display]] or [[target]] -- and regular whitespace/text chunks. for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then -- Check if the token is already a Wikilink (starts with [[ and ends with ]], or contains them) if mw.ustring.match(token, "^%[%[.+%]%]$") then -- If it's already a Wikilink, inject the span to force #999999 color -- while preserving the user's custom target and display text structure. local formatted = mw.ustring.gsub(token, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == token then -- Handle single-target wikilinks like [[ég]] without a pipe formatted = mw.ustring.gsub(token, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end table.insert(tokens, formatted) -- Check if it's purely punctuation elseif mw.ustring.match(token, "^[%p]+$") then table.insert(tokens, token) else -- Separate attached punctuation from the core word (e.g., "word," -> word and ,) local coreWord, punct = mw.ustring.match(token, "^(.-)([%p]+)$") if not coreWord or coreWord == "" then coreWord = token punct = "" end -- Count core word occurrences for duplicate parameters (Requirement 3.5) wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] -- Target fallback order: specific instance -> general word -> original word local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local formatted if punct ~= "" then -- Link only the word, leave punctuation outside and unlinked formatted = string.format('[[%s|<span style="color:#999999;">%s</span>]]<span style="color:#999999;">%s</span>', target, coreWord, punct) else -- Standard word with no punctuation attached formatted = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end table.insert(tokens, formatted) end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end return p modhuysb4efdcml1lwqq813ku30elwz 392368 392367 2026-08-29T04:20:45Z Ow! That Hurts! 8952 392368 Scribunto text/plain local p = {} function p.main(frame) local args = frame:getParent().args -- First parameter is the language code (e.g. "is", "en", "de"), second is the text local lang = args[1] or "" local text = args[2] or "" if text == "" then -- If only one argument was passed, assume it's the text and no language template is specified text = args[1] or "" lang = "" end if text == "" then return "" end local wordCounts = {} local tokens = {} for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then -- Check if the token is an explicit Wikilink (e.g. [[ég|Ég]] or [[ég]]) if mw.ustring.match(token, "^%[%[.+%]%]$") then -- Inject #999999 color into the display text portion of the user's explicit wikilink local formatted = mw.ustring.gsub(token, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == token then -- Handle single-target wikilinks like [[ég]] without a pipe formatted = mw.ustring.gsub(token, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end table.insert(tokens, formatted) -- Check if it's purely punctuation elseif mw.ustring.match(token, "^[%p]+$") then table.insert(tokens, token) else -- Separate attached punctuation from the core word local coreWord, punct = mw.ustring.match(token, "^(.-)([%p]+)$") if not coreWord or coreWord == "" then coreWord = token punct = "" end -- Count core word occurrences for duplicate parameters (Requirement 3.5) wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] -- Target fallback order: specific instance -> general word -> original word local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local formatted if lang ~= "" then -- Expand the language template (e.g., {{is|target}}) to automatically link to the correct Wiktionary entry local expandedTarget = frame:expandTemplate{ title = lang, args = { target } } if expandedTarget and expandedTarget ~= "" then -- Insert the #999999 color span into the expanded template's output structure formatted = string.format('%s<span style="color:#999999;">%s</span>]]', expandedTarget:gsub("%%]%]$", "|"), coreWord) if punct ~= "" then formatted = formatted .. '<span style="color:#999999;">' .. punct .. '</span>' end else -- Fallback if template expansion fails local displayTarget = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, lang, coreWord) if punct ~= "" then displayTarget = displayTarget .. '<span style="color:#999999;">' .. punct .. '</span>' end formatted = displayTarget end else -- Standard linking without a language code prefix if punct ~= "" then formatted = string.format('[[%s|<span style="color:#999999;">%s</span>]]<span style="color:#999999;">%s</span>', target, coreWord, punct) else formatted = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end table.insert(tokens, formatted) end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end return p 1c5ml72az8t89xtc264lr8mopc25xce 392369 392368 2026-08-29T04:22:00Z Ow! That Hurts! 8952 392369 Scribunto text/plain local p = {} function p.main(frame) local args = frame:getParent().args -- First parameter is the language code, second is the text local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end -- Get the current page name from the title object to compare against words local currentPage = mw.title.getCurrentTitle().text local wordCounts = {} local tokens = {} for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then -- Check if the token is an explicit Wikilink if mw.ustring.match(token, "^%[%[.+%]%]$") then -- Extract target and display from explicit wikilink to check if it matches pagename local linkTarget, linkDisplay = mw.ustring.match(token, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(token, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end -- Normalize comparison (case-insensitive for Icelandic or exact match) local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) if isPageMatch then -- If explicit link target matches current page, bold instead of linking local formatted = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) table.insert(tokens, formatted) else -- Otherwise inject #999999 color into the explicit link normally local formatted = mw.ustring.gsub(token, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == token then formatted = mw.ustring.gsub(token, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end table.insert(tokens, formatted) end -- Check if it's purely punctuation elseif mw.ustring.match(token, "^[%p]+$") then table.insert(tokens, token) else -- Separate attached punctuation from the core word local coreWord, punct = mw.ustring.match(token, "^(.-)([%p]+)$") if not coreWord or coreWord == "" then coreWord = token punct = "" end -- Count core word occurrences for duplicate parameters (Requirement 3.5) wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] -- Target fallback order: specific instance -> general word -> original word local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord -- Check if the resolved target matches the current page name (case-insensitive) local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local formatted if isPageMatch then -- If it matches the current page name, format as bold text instead of a link formatted = string.format('<strong style="color:#999999;">%s</strong>', coreWord) if punct ~= "" then formatted = formatted .. string.format('<span style="color:#999999;">%s</span>', punct) end else -- Normal language template linking if lang ~= "" then local expandedTarget = frame:expandTemplate{ title = lang, args = { target } } if expandedTarget and expandedTarget ~= "" then formatted = string.format('%s<span style="color:#999999;">%s</span>]]', expandedTarget:gsub("%%]%]$", "|"), coreWord) if punct ~= "" then formatted = formatted .. string.format('<span style="color:#999999;">%s</span>', punct) end else local displayTarget = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, lang, coreWord) if punct ~= "" then displayTarget = displayTarget .. string.format('<span style="color:#999999;">%s</span>', punct) end formatted = displayTarget end else if punct ~= "" then formatted = string.format('[[%s|<span style="color:#999999;">%s</span>]]<span style="color:#999999;">%s</span>', target, coreWord, punct) else formatted = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end end table.insert(tokens, formatted) end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end p = p -- keep linter happy return p 921o9se8kfmiglemn1meur2qg9b5xq3 392370 392369 2026-08-29T04:27:25Z Ow! That Hurts! 8952 392370 Scribunto text/plain local p = {} function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local wordCounts = {} local tokens = {} for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then -- Check if the token is an explicit Wikilink, optionally surrounded or touched by punctuation -- e.g., "[[ég|Ég]]," or "([[ég]])" local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^([%P]-)(%[%[.+%]%])([%P]-)$") if innerLink then -- Handle explicit Wikilink wrapped with custom or universal punctuation local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end -- Wrap surrounding punctuation with #999999 color local formattedToken = "" if leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end table.insert(tokens, formattedToken) else -- Separate universal punctuation (from any script/language) preceding and following the core word local leadingPunct, coreWord, trailingPunct = mw.ustring.match(token, "^([%P]-)(%w+)([%P]-)$") -- Fallback if word contains international letters/characters not caught by standard %w if not coreWord then leadingPunct, coreWord, trailingPunct = mw.ustring.match(token, "^([%P]-)([^%P]+)([%P]-)$") end if not coreWord or coreWord == "" then -- Pure punctuation chunk of any kind table.insert(tokens, string.format('<span style="color:#999999;">%s</span>', token)) else wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local expandedTarget = frame:expandTemplate{ title = lang, args = { target } } if expandedTarget and expandedTarget ~= "" then processedWord = string.format('%s<span style="color:#999999;">%s</span>]]', expandedTarget:gsub("%%]%]$", "|"), coreWord) else processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, lang, coreWord) end else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end -- Assemble with leading and trailing punctuation styled properly local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end return p k1biyzishqpt9hab7g6e3cshxua1ju1 392371 392370 2026-08-29T04:29:25Z Ow! That Hurts! 8952 392371 Scribunto text/plain local p = {} function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local wordCounts = {} local tokens = {} for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then -- Match explicit wikilinks even if wrapped in punctuation (e.g. [[ég]], or ([[ég]])) -- We capture leading punctuation, the exact wikilink body, and trailing punctuation local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else -- Inject #999999 properly inside the wikilink display text so the link text itself stays grey local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end table.insert(tokens, formattedToken) else -- Isolate leading punctuation, the actual word characters (including international letters), and trailing punctuation local leadingPunct, coreWord, trailingPunct = mw.ustring.match(token, "^([%p]*)(.-)([%p]*)$") -- Ensure we cleanly split out the core alphanumeric/unicode word from any punctuation attached to it local cleanWord, coreTrailing = mw.ustring.match(token, "^([%p]*)([%w%z\128-\255]+)([%p]*)$") if cleanWord and coreWord and mw.ustring.len(coreWord) >= mw.ustring.len(cleanWord or "") then -- Keep the better match end -- Fallback pattern to grab any continuous block of characters that contains letters/words local lP, wordPart, tP = mw.ustring.match(token, "^(.-)([%a\192-\255]+[%a\192-\255%p]*)(.-)$") if wordPart and wordPart ~= "" then leadingPunct = lP coreWord = wordPart trailingPunct = tP else coreWord = token leadingPunct = "" trailingPunct = "" end -- If the entire token is just punctuation if mw.ustring.match(token, "^[%p]+$") then table.insert(tokens, string.format('<span style="color:#999999;">%s</span>', token)) else -- Re-verify coreWord doesn't accidentally contain punctuation-only sequences local actualWord, actualPunct = mw.ustring.match(coreWord, "^(.-)([%p]+)$") if actualWord and actualWord ~= "" and mw.ustring.match(actualPunct, "^[%p]+$") then coreWord = actualWord trailingPunct = actualPunct .. (trailingPunct or "") end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local expandedTarget = frame:expandTemplate{ title = lang, args = { target } } if expandedTarget and expandedTarget ~= "" then processedWord = string.format('%s<span style="color:#999999;">%s</span>]]', expandedTarget:gsub("%%]%]$", "|"), coreWord) else processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, lang, coreWord) end else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end return p dkhlleaojrtz36nmuf4hizzcnyocfx2 392372 392371 2026-08-29T04:30:08Z Ow! That Hurts! 8952 392372 Scribunto text/plain local p = {} function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local wordCounts = {} local tokens = {} for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then -- Safely use mw.ustring instead of standard string.match for UTF-8 safety local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end table.insert(tokens, formattedToken) else -- Check if the token is pure punctuation if mw.ustring.match(token, "^[%p]+$") then table.insert(tokens, string.format('<span style="color:#999999;">%s</span>', token)) else -- Safely separate punctuation from the word using mw.ustring to handle Icelandic characters without throwing errors local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" -- Strip leading and trailing punctuation to isolate the core word safely local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end -- If stripping punctuation left nothing or the core word is invalid, fallback to the raw token if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local expandedTarget = frame:expandTemplate{ title = lang, args = { target } } if expandedTarget and expandedTarget ~= "" then processedWord = string.format('%s<span style="color:#999999;">%s</span>]]', expandedTarget:gsub("%%]%]$", "|"), coreWord) else processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, lang, coreWord) end else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end return p 6fl2s9ydfdkdlhgubf5ow8tow3jkbil 392373 392372 2026-08-29T04:33:04Z Ow! That Hurts! 8952 392373 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a language name/anchor if needed local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local wordCounts = {} local tokens = {} for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end table.insert(tokens, formattedToken) else if mw.ustring.match(token, "^[%p]+$") then table.insert(tokens, string.format('<span style="color:#999999;">%s</span>', token)) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then -- Capitalize the language parameter output to match Wiktionary section capitalization standards (e.g. {{Is|...}}) local capitalizedLang = capitalizeFirst(lang) local expandedTarget = frame:expandTemplate{ title = capitalizedLang, args = { target } } -- Fallback to lowercase if capital template isn't found if (not expandedTarget or expandedTarget == "") and capitalizedLang ~= lang then expandedTarget = frame:expandTemplate{ title = lang, args = { target } } end if expandedTarget and expandedTarget ~= "" then processedWord = string.format('%s<span style="color:#999999;">%s</span>]]', expandedTarget:gsub("%%]%]$", "|"), coreWord) else processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) end else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end return p 9g9t9bdwd5ley2fqyoteri88xw9pe97 392374 392373 2026-08-29T04:34:19Z Ow! That Hurts! 8952 392374 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string (e.g. language name anchor) local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local wordCounts = {} local tokens = {} for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end table.insert(tokens, formattedToken) else if mw.ustring.match(token, "^[%p]+$") then table.insert(tokens, string.format('<span style="color:#999999;">%s</span>', token)) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then -- Keep template invocation clean using the lower/exact lang code, -- and capitalize the language name component inside the generated output link. local expandedTarget = frame:expandTemplate{ title = lang, args = { target } } if expandedTarget and expandedTarget ~= "" then -- The template expands to something like [[target#language|target]] or [[target#language]] -- We capitalize the language text or section header after the '#' symbol. local capitalizedTarget = mw.ustring.gsub(expandedTarget, "#([^%|%]]+)", function(langStr) return "#" .. capitalizeFirst(langStr) end) processedWord = string.format('%s<span style="color:#999999;">%s</span>]]', capitalizedTarget:gsub("%%]%]$", "|"), coreWord) else processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizeFirst(lang), coreWord) end else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end return p lxxye2hyk7xb4r4sd8t1o3pyh5bswgb 392375 392374 2026-08-29T04:35:05Z Ow! That Hurts! 8952 392375 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string (e.g., language name anchor) local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local wordCounts = {} local tokens = {} for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end table.insert(tokens, formattedToken) else if mw.ustring.match(token, "^[%p]+$") then table.insert(tokens, string.format('<span style="color:#999999;">%s</span>', token)) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then -- Explicitly capitalize the language name before expanding the template -- so that templates like {{Íslenska|...}} receive the properly capitalized argument. local capitalizedLang = capitalizeFirst(lang) local expandedTarget = frame:expandTemplate{ title = capitalizedLang, args = { target } } -- Fallback to lowercase if capital template doesn't exist if (not expandedTarget or expandedTarget == "") and capitalizedLang ~= lang then expandedTarget = frame:expandTemplate{ title = lang, args = { target } } end if expandedTarget and expandedTarget ~= "" then processedWord = string.format('%s<span style="color:#999999;">%s</span>]]', expandedTarget:gsub("%%]%]$", "|"), coreWord) else processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) end else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end return p 2u4o24iv9kb4lno9y09mpnpvuit3o17 392376 392375 2026-08-29T04:36:18Z Ow! That Hurts! 8952 392376 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local wordCounts = {} local tokens = {} for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end table.insert(tokens, formattedToken) else if mw.ustring.match(token, "^[%p]+$") then table.insert(tokens, string.format('<span style="color:#999999;">%s</span>', token)) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then -- Invoke the template using the clean lowercase language code string local expandedTarget = frame:expandTemplate{ title = lang, args = { target } } if expandedTarget and expandedTarget ~= "" then -- Target the specific result segment inside the expanded output string -- (e.g., changing [[target#islandic|display]] or template text outputs to capitalize the first letter of the result anchor/name) local capitalizedResult = mw.ustring.gsub(expandedTarget, "(%#)([%a])", function(hash, firstChar) return hash .. mw.ustring.upper(firstChar) end) processedWord = string.format('%s<span style="color:#999999;">%s</span>]]', capitalizedResult:gsub("%%]%]$", "|"), coreWord) else processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizeFirst(lang), coreWord) end else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end return p i97eohw2ulgjupm0hlxjyohcungejqy 392377 392376 2026-08-29T04:41:13Z Ow! That Hurts! 8952 392377 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local wordCounts = {} local tokens = {} for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end table.insert(tokens, formattedToken) else if mw.ustring.match(token, "^[%p]+$") then table.insert(tokens, string.format('<span style="color:#999999;">%s</span>', token)) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then -- Invoke the template normally using the uncapitalized language name/code local expandedTarget = frame:expandTemplate{ title = lang, args = { target } } if expandedTarget and expandedTarget ~= "" then -- Capitalise only the first letter of the fragment/output portion following '#' local capitalizedOutput = mw.ustring.gsub(expandedTarget, "(%#)([a-z%z\128-\255])", function(hash, firstChar) return hash .. mw.ustring.upper(firstChar) end) processedWord = string.format('%s<span style="color:#999999;">%s</span>]]', capitalizedOutput:gsub("%%]%]$", "|"), coreWord) else processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizeFirst(lang), coreWord) end else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end return p qne25ju2a5fz5ygie0q6ikcoa4pzjc9 392378 392377 2026-08-29T04:43:44Z Ow! That Hurts! 8952 392378 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local wordCounts = {} local tokens = {} for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end table.insert(tokens, formattedToken) else if mw.ustring.match(token, "^[%p]+$") then table.insert(tokens, string.format('<span style="color:#999999;">%s</span>', token)) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local expandedTarget = frame:expandTemplate{ title = lang, args = { target } } if expandedTarget and expandedTarget ~= "" then -- Safely use mw.ustring.gsub instead of standard string.gsub to prevent UTF-8 pattern crashes local capitalizedOutput = mw.ustring.gsub(expandedTarget, "(%#)([^%|%]]+)", function(hash, langSegment) return hash .. capitalizeFirst(langSegment) end) processedWord = string.format('%s<span style="color:#999999;">%s</span>]]', capitalizedOutput:gsub("%%]%]$", "|"), coreWord) else processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizeFirst(lang), coreWord) end else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end return p 3pitzos4r55nhkts8axhqvfmfraizxx 392379 392378 2026-08-29T04:45:41Z Ow! That Hurts! 8952 392379 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local wordCounts = {} local tokens = {} for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end table.insert(tokens, formattedToken) else if mw.ustring.match(token, "^[%p]+$") then table.insert(tokens, string.format('<span style="color:#999999;">%s</span>', token)) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then -- Instead of relying on template string pattern manipulation which fails, -- we directly construct the Wikilink target manually using the capitalized language name: -- e.g., [[target#CapitalizedLang|<span style="color:#999999;">coreWord</span>]] local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end return p rd2rh6jrsch6daacatg52j4h9otf73z 392381 392379 2026-08-29T04:51:16Z Ow! That Hurts! 8952 392381 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end table.insert(tokens, formattedToken) else if mw.ustring.match(token, "^[%p]+$") then table.insert(tokens, string.format('<span style="color:#999999;">%s</span>', token)) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text -- Check if 'litill' or 'margur' parameters are provided local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] if litillText or margurText then local results = {} if litillText then table.insert(results, processText(litillText, lang, args, currentPage)) end if margurText then table.insert(results, processText(margurText, lang, args, currentPage)) end -- Return both strings separated by a newline or space (adjust separator as needed) return table.concat(results, "<br/>") else -- Standard single behavior return processText(text, lang, args, currentPage) end end return p 5p29h99bl4mt9av63uj78db8f3wne7b 392382 392381 2026-08-29T04:53:58Z Ow! That Hurts! 8952 392382 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end table.insert(tokens, formattedToken) else if mw.ustring.match(token, "^[%p]+$") then table.insert(tokens, string.format('<span style="color:#999999;">%s</span>', token)) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage) local processedMargur = processText(margurText, lang, args, currentPage) -- Generate a random integer (e.g., between 1 and 100000) math.randomseed(os.time()) local randomNumber = math.random(1, 100000) -- Expand the {{stutt tilvitnun}} template with the random number, lítill text, and margur text return frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber, processedLitill, processedMargur } } else -- Standard single behavior if neither parameter is passed return processText(text, lang, args, currentPage) end end return p 9rlvc5816t79aleazjep0evvaomp76j 392383 392382 2026-08-29T04:58:10Z Ow! That Hurts! 8952 392383 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then formattedToken = "• " .. formattedToken isFirstToken = false end table.insert(tokens, formattedToken) else if mw.ustring.match(token, "^[%p]+$") then -- If the very first item is pure punctuation, prepend bullet to it if requested local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = "• " .. puncToken isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = "• " .. finalFormatted isFirstToken = false end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] -- Check if 'enginn depill' parameter is used local addBullet = not (args["enginn depill"] or args["enginn_depill"]) if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) math.randomseed(os.time()) local randomNumber = math.random(1, 100000) return frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber, processedLitill, processedMargur } } else return processText(text, lang, args, currentPage, addBullet) end end return p gnu30cchemlk0subshe9j656khk4k5w 392384 392383 2026-08-29T04:59:16Z Ow! That Hurts! 8952 392384 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then formattedToken = string.format('<span style="color:#999999;">• </span>%s', formattedToken) isFirstToken = false end table.insert(tokens, formattedToken) else if mw.ustring.match(token, "^[%p]+$") then local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] local addBullet = not (args["enginn depill"] or args["enginn_depill"]) if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) math.randomseed(os.time()) local randomNumber = math.random(1, 100000) return frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber, processedLitill, processedMargur } } else return processText(text, lang, args, currentPage, addBullet) end end return p daa9w4k99bafgl8qjxg64v8yyco3wsr 392385 392384 2026-08-29T05:13:28Z Ow! That Hurts! 8952 392385 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then formattedToken = string.format('<span style="color:#999999;">• </span>%s', formattedToken) isFirstToken = false end table.insert(tokens, formattedToken) else if mw.ustring.match(token, "^[%p]+$") then local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] local addBullet = not (args["enginn depill"] or args["enginn_depill"]) math.randomseed(os.time()) local randomNumber = math.random(1, 100000) if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) return frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber, processedLitill, processedMargur } } elseif args["full tilvitnun"] then local author = args["höfundur"] or "" local year = args["árið"] or "" local authorFormatted = "" if author ~= "" then local upperAuthor = frame:expandTemplate{ title = "hástafir", args = { author } } authorFormatted = upperAuthor if year ~= "" then authorFormatted = authorFormatted .. "," end end local secondArg = authorFormatted if year ~= "" then if authorFormatted ~= "" then secondArg = secondArg .. " " .. year else secondArg = year end end return frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber, secondArg, args["full tilvitnun"] } } else return processText(text, lang, args, currentPage, addBullet) end end return p nzl1gx16y3aftwqdsvhlsqq7bq0azz9 392386 392385 2026-08-29T05:14:22Z Ow! That Hurts! 8952 392386 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then formattedToken = string.format('<span style="color:#999999;">• </span>%s', formattedToken) isFirstToken = false end table.insert(tokens, formattedToken) else if mw.ustring.match(token, "^[%p]+$") then local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] local fullText = args["full tilvitnun"] local addBullet = not (args["enginn depill"] or args["enginn_depill"]) math.randomseed(os.time()) local randomNumber = math.random(1, 100000) if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) return frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber, processedLitill, processedMargur } } elseif fullText then local author = args["höfundur"] or "" local year = args["árið"] or "" local authorFormatted = "" if author ~= "" then authorFormatted = frame:expandTemplate{ title = "hástafir", args = { author } } if year ~= "" then authorFormatted = authorFormatted .. "," end end local secondArg = authorFormatted if year ~= "" then if authorFormatted ~= "" then secondArg = secondArg .. " " .. year else secondArg = year end end local processedFull = processText(fullText, lang, args, currentPage, addBullet) return frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber, secondArg, processedFull } } else return processText(text, lang, args, currentPage, addBullet) end end return p n46zqktlxtt3zzv61wg7mh54srnvuqe 392387 392386 2026-08-29T05:15:16Z Ow! That Hurts! 8952 392387 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then formattedToken = string.format('<span style="color:#999999;">• </span>%s', formattedToken) isFirstToken = false end table.insert(tokens, formattedToken) else if mw.ustring.match(token, "^[%p]+$") then local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] local fullText = args["full tilvitnun"] local addBullet = not (args["enginn depill"] or args["enginn_depill"]) math.randomseed(os.time()) local randomNumber = math.random(1, 100000) if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) return string.format("{{stutt tilvitnun|%d|%s|%s}}", randomNumber, processedLitill, processedMargur) elseif fullText then local author = args["höfundur"] or "" local year = args["árið"] or "" local authorFormatted = "" if author ~= "" then authorFormatted = frame:expandTemplate{ title = "hástafir", args = { author } } if year ~= "" then authorFormatted = authorFormatted .. "," end end local secondArg = authorFormatted if year ~= "" then if authorFormatted ~= "" then secondArg = secondArg .. " " .. year else secondArg = year end end local processedFull = processText(fullText, lang, args, currentPage, addBullet) return string.format("{{stutt tilvitnun|%d|%s|%s}}", randomNumber, secondArg, processedFull) else return processText(text, lang, args, currentPage, addBullet) end end return p kur5oyanlaxr2apjod9g2tlchrwnfqv 392388 392387 2026-08-29T05:16:04Z Ow! That Hurts! 8952 392388 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then formattedToken = string.format('<span style="color:#999999;">• </span>%s', formattedToken) isFirstToken = false end table.insert(tokens, formattedToken) else if mw.ustring.match(token, "^[%p]+$") then local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#99999-9;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] local fullText = args["full tilvitnun"] local addBullet = not (args["enginn depill"] or args["enginn_depill"]) math.randomseed(os.time()) local randomNumber = math.random(1, 100000) if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) return frame:expandTemplate{ title = "stutt tilvitnun", args = { tostring(randomNumber), processedLitill, processedMargur } } elseif fullText then local author = args["höfundur"] or "" local year = args["árið"] or "" local authorFormatted = "" if author ~= "" then authorFormatted = frame:expandTemplate{ title = "hástafir", args = { author } } if year ~= "" then authorFormatted = authorFormatted .. "," end end local secondArg = authorFormatted if year ~= "" then if authorFormatted ~= "" then secondArg = secondArg .. " " .. year else secondArg = year end end local processedFull = processText(fullText, lang, args, currentPage, addBullet) return frame:expandTemplate{ title = "stutt tilvitnun", args = { tostring(randomNumber), secondArg, processedFull } } else return processText(text, lang, args, currentPage, addBullet) end end return p fyf8pvvwpcwlywkivafoadwui6hsqxp 392389 392388 2026-08-29T05:18:11Z Ow! That Hurts! 8952 392389 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then formattedToken = string.format('<span style="color:#999999;">• </span>%s', formattedToken) isFirstToken = false end table.insert(tokens, formattedToken) else if mw.ustring.match(token, "^[%p]+$") then local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local addBullet = not (args["enginn depill"] or args["enginn_depill"]) -- Check for lítill/margur pair local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] -- Check for stuttur/langur pair local stutturText = args["stuttur"] local langurText = args["langur"] local outputs = {} if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) math.randomseed(os.time()) local randomNumber1 = math.random(1, 100000) table.insert(outputs, frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber1, processedLitill, processedMargur } }) end if stutturText or langurText then local processedStuttur = processText(stutturText, lang, args, currentPage, addBullet) local processedLangur = processText(langurText, lang, args, currentPage, addBullet) math.randomseed(os.time() + 1) local randomNumber2 = math.random(1, 100000) table.insert(outputs, frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber2, processedStuttur, processedLangur } }) end if #outputs > 0 then return table.concat(outputs, "\n") else -- Standard single behavior if none of the specific pairs are passed return processText(text, lang, args, currentPage, addBullet) end end return p gez671x9rufjdqb64po7241vhvej1fi 392390 392389 2026-08-29T05:19:16Z Ow! That Hurts! 8952 392390 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then formattedToken = string.format('<span style="color:#999999;">• </span>%s', formattedToken) isFirstToken = false end table.insert(tokens, formattedToken) else if mw.ustring.match(token, "^[%p]+$") then local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end -- Helper function for unformatted plain text processing (no grey styling, no links, no bullets) local function processPlainText(text) if not text or text == "" then return "" end local tokens = {} for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then table.insert(tokens, token) if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local addBullet = not (args["enginn depill"] or args["enginn_depill"]) -- Check for lítill/margur pair local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] -- Check for stuttur/langur pair local stutturText = args["stuttur"] local langurText = args["langur"] local outputs = {} if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) math.randomseed(os.time()) local randomNumber1 = math.random(1, 100000) table.insert(outputs, frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber1, processedLitill, processedMargur } }) end if stutturText or langurText then -- Use plain text processing without any of the grey formatting, links, or bullets local processedStuttur = processPlainText(stutturText) local processedLangur = processPlainText(langurText) math.randomseed(os.time() + 1) local randomNumber2 = math.random(1, 100000) table.insert(outputs, frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber2, processedStuttur, processedLangur } }) end if #outputs > 0 then -- Join them with a single space so they print on the same line right after each other return table.concat(outputs, " ") else -- Standard single behavior if none of the specific pairs are passed return processText(text, lang, args, currentPage, addBullet) end end return p 9k3b86k79r7v2asddmukkmjf14pgdwy 392391 392390 2026-08-29T05:26:00Z Ow! That Hurts! 8952 392391 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then formattedToken = string.format('<span style="color:#999999;">• </span>%s', formattedToken) isFirstToken = false end table.insert(tokens, formattedToken) else if mw.ustring.match(token, "^[%p]+$") then local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end -- Helper function for unformatted plain text processing (no grey styling, no links, no bullets) local function processPlainText(text) if not text or text == "" then return "" end local tokens = {} for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then table.insert(tokens, token) if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end function p.main(frame) local parentFrame = frame:getParent() local args = parentFrame.args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local addBullet = not (args["enginn depill"] or args["enginn_depill"]) -- Check for lítill/margur pair local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] -- Check for explicit stuttur/langur arguments passed to Lua, -- but we also want to support parsing the requested wikitext expressions if they are supplied via template parameters. local stutturText = args["stuttur"] local langurText = args["langur"] local outputs = {} if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) math.randomseed(os.time()) local randomNumber1 = math.random(1, 100000) table.insert(outputs, frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber1, processedLitill, processedMargur } }) end -- If stuttur or langur are provided (or if we want to evaluate the requested wikitext template expressions) if stutturText or langurText or args["höfundur"] or args["árið"] or args["dagsetning"] or args["fullur höfundur"] or args["full tilvitnun"] then -- Evaluate the requested wikitext expressions via frame:preprocess so parser functions like #if and templates like hástafir work correctly local evaluatedStuttur = frame:preprocess("{{#if:{{{höfundur|}}}|{{hástafir|{{{höfundur}}}}}{{#if:{{{árið|}}}|,}}}} {{#if:{{{árið|}}}|{{{árið}}}}}") local evaluatedLangur = frame:preprocess("{{#if:{{{dagsetning|}}}|{{{dagsetning}}}, |{{{árið}}}, }}{{hástafir|{{#if:{{{fullur höfundur|}}}|{{{fullur höfundur}}}, |{{{höfundur}}}, }}}}{{{full tilvitnun}}}") local processedStuttur = processPlainText(evaluatedStuttur) local processedLangur = processPlainText(evaluatedLangur) math.randomseed(os.time() + 1) local randomNumber2 = math.random(1, 100000) table.insert(outputs, frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber2, processedStuttur, processedLangur } }) end if #outputs > 0 then return table.concat(outputs, " ") else return processText(text, lang, args, currentPage, addBullet) end end return p 69kdhhzyf5dph5wbmka1ax8yan2laod 392392 392391 2026-08-29T05:28:16Z Ow! That Hurts! 8952 392392 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then formattedToken = string.format('<span style="color:#999999;">• </span>%s', formattedToken) isFirstToken = false end table.insert(tokens, formattedToken) else if mw.ustring.match(token, "^[%p]+$") then local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end -- Helper function for unformatted plain text processing (no grey styling, no links, no bullets) local function processPlainText(text) if not text or text == "" then return "" end local tokens = {} for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then table.insert(tokens, token) if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end function p.main(frame) local parentFrame = frame:getParent() local args = parentFrame.args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local addBullet = not (args["enginn depill"] or args["enginn_depill"]) -- Check for lítill/margur pair local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] -- Check for stuttur/langur pair or specific citation parameters local stutturText = args["stuttur"] local langurText = args["langur"] local outputs = {} if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) math.randomseed(os.time()) local randomNumber1 = math.random(1, 100000) table.insert(outputs, frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber1, processedLitill, processedMargur } }) end -- If stuttur/langur parameters or citation metadata are provided if stutturText or langurText or args["höfundur"] or args["árið"] or args["dagsetning"] or args["fullur höfundur"] or args["full tilvitnun"] then -- Build the exact wikitext expression dynamically using string concatenation and table parameters -- so that frame:preprocess parses the template logic correctly. local stutturWikitext = stutturText or "{{#if:{{{höfundur|}}}|{{hástafir|{{{höfundur}}}}}{{#if:{{{árið|}}}|,}}}} {{#if:{{{árið|}}}|{{{árið}}}}}" local langurWikitext = langurText or "{{#if:{{{dagsetning|}}}|{{{dagsetning}}}, |{{{árið}}}, }}{{hástafir|{{#if:{{{fullur höfundur|}}}|{{{fullur höfundur}}}, |{{{höfundur}}}, }}}}{{{full tilvitnun|}}}" local evaluatedStuttur = frame:preprocess(stutturWikitext) local evaluatedLangur = frame:preprocess(langurWikitext) local processedStuttur = processPlainText(evaluatedStuttur) local processedLangur = processPlainText(evaluatedLangur) math.randomseed(os.time() + 1) local randomNumber2 = math.random(1, 100000) table.insert(outputs, frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber2, processedStuttur, processedLangur } }) end if #outputs > 0 then return table.concat(outputs, " ") else return processText(text, lang, args, currentPage, addBullet) end end return p akkpl7wi0ttgcgq9wvkb4qnpk8o4hcd 392393 392392 2026-08-29T05:30:33Z Ow! That Hurts! 8952 392393 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then formattedToken = string.format('<span style="color:#999999;">• </span>%s', formattedToken) isFirstToken = false end table.insert(tokens, formattedToken) else if mw.ustring.match(token, "^[%p]+$") then local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end -- Helper function for unformatted plain text processing (no grey styling, no links, no bullets) local function processPlainText(text) if not text or text == "" then return "" end local tokens = {} for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then table.insert(tokens, token) if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end function p.main(frame) local parentFrame = frame:getParent() local args = parentFrame.args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local addBullet = not (args["enginn depill"] or args["enginn_depill"]) -- Check for lítill/margur pair local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] -- Check for stuttur/langur pair or citation metadata local stutturText = args["stuttur"] local langurText = args["langur"] local outputs = {} if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) math.randomseed(os.time()) local randomNumber1 = math.random(1, 100000) table.insert(outputs, frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber1, processedLitill, processedMargur } }) end if stutturText or langurText or args["höfundur"] or args["árið"] or args["dagsetning"] or args["fullur höfundur"] or args["full tilvitnun"] then local stutturWikitext = stutturText or "{{#if:{{{höfundur|}}}|{{hástafir|{{{höfundur}}}}}{{#if:{{{árið|}}}|,}}}} {{#if:{{{árið|}}}|{{{árið}}}}}" -- Updated langur wikitext: -- 1st parameter uses dagsetning if filled, otherwise árið -- 2nd parameter uses fullur höfundur if filled, otherwise höfundur local langurWikitext = langurText or "{{#if:{{{dagsetning|}}}|{{{dagsetning}}}|{{{árið}}}}}, {{hástafir|{{#if:{{{fullur höfundur|}}}|{{{fullur höfundur}}}|{{{höfundur}}}}}}}, {{{full tilvitnun|}}}" local evaluatedStuttur = frame:preprocess(stutturWikitext) local evaluatedLangur = frame:preprocess(langurWikitext) local processedStuttur = processPlainText(evaluatedStuttur) local processedLangur = processPlainText(evaluatedLangur) math.randomseed(os.time() + 1) local randomNumber2 = math.random(1, 100000) table.insert(outputs, frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber2, processedStuttur, processedLangur } }) end if #outputs > 0 then return table.concat(outputs, " ") else return processText(text, lang, args, currentPage, addBullet) end end return p d28j4eg14pp7h4ikne7ug4h18v64owj 392397 392393 2026-08-29T05:39:40Z Ow! That Hurts! 8952 392397 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then formattedToken = string.format('<span style="color:#999999;">• </span>%s', formattedToken) isFirstToken = false end table.insert(tokens, formattedToken) else if mw.ustring.match(token, "^[%p]+$") then local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] local addBullet = not (args["enginn depill"] or args["enginn_depill"]) if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) math.randomseed(os.time()) local randomNumber = math.random(1, 100000) return frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber, processedLitill, processedMargur } } else return processText(text, lang, args, currentPage, addBullet) end end return p daa9w4k99bafgl8qjxg64v8yyco3wsr 392399 392397 2026-08-29T05:56:01Z Ow! That Hurts! 8952 392399 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else -- Safely apply grey styling to existing explicit wikilinks while avoiding code-breaking replacements local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then formattedToken = string.format('<span style="color:#999999;">• </span>%s', formattedToken) isFirstToken = false end table.insert(tokens, formattedToken) else if mw.ustring.match(token, "^[%p]+$") then local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPuntut) or mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] local addBullet = not (args["enginn depill"] or args["enginn_depill"]) if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) math.randomseed(os.time()) local randomNumber = math.random(1, 100000) return frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber, processedLitill, processedMargur } } else return processText(text, lang, args, currentPage, addBullet) end end return p 4401q5endysm376xsexbkvwz2kehs6s 392400 392399 2026-08-29T05:56:45Z Ow! That Hurts! 8952 392400 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then -- Match explicit wikilinks (even with spaces like [[von der Hagen#Þýska|von der Hagen]]) local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then formattedToken = string.format('<span style="color:#999999;">• </span>%s', formattedToken) isFirstToken = false end table.insert(tokens, formattedToken) else -- Check for multi-word explicit links that might have been broken by %S+ chunking if mw.ustring.match(token, "%[%[") and not mw.ustring.match(token, "%]%]") then -- Accumulate tokens until the closing brackets are found, or handle multi-word link parts gracefully table.insert(tokens, string.format('<span style="color:#999999;">%s</span>', token)) elseif mw.ustring.match(token, "^[%p]+$") then local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] local addBullet = not (args["enginn depill"] or args["enginn_depill"]) if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) math.randomseed(os.time()) local randomNumber = math.random(1, 100000) return frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber, processedLitill, processedMargur } } else return processText(text, lang, args, currentPage, addBullet) end end return p f7n6f81ra9phmk24oj1scmpai0epkyi 392401 392400 2026-08-29T05:58:19Z Ow! That Hurts! 8952 392401 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true -- We tokenize by capturing either a full [[...]] wikilink or non-whitespace chunks for chunk in mw.ustring.gmatch(text, "(%[%[.-%]%]|%S+)(%s*)") do -- Since gmatch with two capture groups returns two values per match: -- Let's use a robust pattern loop instead: end -- Let's iterate properly handling both wikilinks and standard words local pos = 1 local textLen = mw.ustring.len(text) while pos <= textLen do -- Check if we are at the start of a wikilink local startLink, endLink = mw.ustring.find(text, "^%[%[.-%]%]", pos) if startLink then local innerLink = mw.ustring.sub(text, startLink, endLink) pos = endLink + 1 -- Parse the wikilink components: [[target#anchor|display]] or [[target|display]] or [[target]] local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end -- If it has an anchor like target#anchor, extract just the page target for page match checks local pureTarget = mw.ustring.match(linkTarget, "^([^#]+)") or linkTarget local isPageMatch = pureTarget and (mw.ustring.lower(pureTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end if isFirstToken and addBullet then processedLink = string.format('<span style="color:#999999;">• </span>%s', processedLink) isFirstToken = false end table.insert(tokens, processedLink) else -- Consume regular word/chunk up to the next wikilink or whitespace local nextLink = mw.ustring.find(text, "%[%[", pos) local nextSpace = mw.ustring.find(text, "%s", pos) local endChunk = textLen if nextLink and nextSpace then endChunk = math.min(nextLink - 1, nextSpace) elseif nextLink then endChunk = nextLink - 1 elseif nextSpace then endChunk = nextSpace - 1 end local token = mw.ustring.sub(text, pos, endChunk) pos = endChunk + 1 if token ~= "" then if mw.ustring.match(token, "^[%p]+$") then local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end -- Consume following whitespace block if present local startSpace, endSpace = mw.ustring.find(text, "^%s+", pos) if startSpace then local spaceChunk = mw.ustring.sub(text, startSpace, endSpace) table.insert(tokens, spaceChunk) pos = endSpace + 1 end end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] local addBullet = not (args["enginn depill"] or args["enginn_depill"]) if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) math.randomseed(os.time()) local randomNumber = math.random(1, 100000) return frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber, processedLitill, processedMargur } } else return processText(text, lang, args, currentPage, addBullet) end end return p 0c1t2trs8wfw1jkwcptkzspwnhagjp2 392402 392401 2026-08-29T05:58:50Z Ow! That Hurts! 8952 392402 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true local pos = 1 local textLen = mw.ustring.len(text) while pos <= textLen do -- Check if we are at the start of a wikilink local startLink, endLink = mw.ustring.find(text, "^%[%[.-%]%]", pos) if startLink then local innerLink = mw.ustring.sub(text, startLink, endLink) pos = endLink + 1 -- Safe extraction of target and display for [[target#anchor|display]] or [[target]] local linkTarget = "" local linkDisplay = "" local pipePos = mw.ustring.find(innerLink, "|", 1, true) if pipePos then linkTarget = mw.ustring.sub(innerLink, 3, pipePos - 1) linkDisplay = mw.ustring.sub(pipePos + 1, mw.ustring.len(innerLink) - 2) else linkTarget = mw.ustring.sub(innerLink, 3, mw.ustring.len(innerLink) - 2) linkDisplay = linkTarget end -- Extract pure target ignoring anchors (e.g., von der Hagen#Þýska -> von der Hagen) local hashPos = mw.ustring.find(linkTarget, "#", 1, true) local pureTarget = hashPos and mw.ustring.sub(linkTarget, 1, hashPos - 1) or linkTarget local isPageMatch = pureTarget and (mw.ustring.lower(pureTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else -- Safely rebuild the link with grey display text processedLink = string.format('[[%s|<span style="color:#999999;">%s</span>]]', linkTarget, linkDisplay) end if isFirstToken and addBullet then processedLink = string.format('<span style="color:#999999;">• </span>%s', processedLink) isFirstToken = false end table.insert(tokens, processedLink) else -- Consume regular word/chunk up to the next wikilink or whitespace local nextLink = mw.ustring.find(text, "%[%[", pos) local nextSpace = mw.ustring.find(text, "%s", pos) local endChunk = textLen if nextLink and nextSpace then endChunk = math.min(nextLink - 1, nextSpace) elseif nextLink then endChunk = nextLink - 1 elseif nextSpace then endChunk = nextSpace - 1 end local token = mw.ustring.sub(text, pos, endChunk) pos = endChunk + 1 if token ~= "" then if mw.ustring.match(token, "^[%p]+$") then local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end -- Consume following whitespace block if present local startSpace, endSpace = mw.ustring.find(text, "^%s+", pos) if startSpace then local spaceChunk = mw.ustring.sub(text, startSpace, endSpace) table.insert(tokens, spaceChunk) pos = endSpace + 1 end end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] local addBullet = not (args["enginn depill"] or args["enginn_depill"]) if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) math.randomseed(os.time()) local randomNumber = math.random(1, 100000) return frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber, processedLitill, processedMargur } } else return processText(text, lang, args, currentPage, addBullet) end end return p fk4c39f3ndc6mrwvljc9t9vrln1qgx2 392403 392402 2026-08-29T05:59:58Z Ow! That Hurts! 8952 392403 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true local pos = 1 local textLen = mw.ustring.len(text) while pos <= textLen do -- Check if we are at the start of a wikilink local startLink, endLink = mw.ustring.find(text, "^%[%[.-%]%]", pos) if startLink then local innerLink = mw.ustring.sub(text, startLink, endLink) pos = endLink + 1 -- Safe extraction of target and display for [[target#anchor|display]] or [[target]] local linkTarget = "" local linkDisplay = "" local pipePos = mw.ustring.find(innerLink, "|", 1, true) if pipePos then linkTarget = mw.ustring.sub(innerLink, 3, pipePos - 1) -- Fix index range calculation for mw.ustring.sub (start, end) linkDisplay = mw.ustring.sub(innerLink, pipePos + 1, mw.ustring.len(innerLink) - 2) else linkTarget = mw.ustring.sub(innerLink, 3, mw.ustring.len(innerLink) - 2) linkDisplay = linkTarget end -- Extract pure target ignoring anchors (e.g., von der Hagen#Þýska -> von der Hagen) local hashPos = mw.ustring.find(linkTarget, "#", 1, true) local pureTarget = hashPos and mw.ustring.sub(linkTarget, 1, hashPos - 1) or linkTarget local isPageMatch = pureTarget and (mw.ustring.lower(pureTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else processedLink = string.format('[[%s|<span style="color:#999999;">%s</span>]]', linkTarget, linkDisplay) end if isFirstToken and addBullet then processedLink = string.format('<span style="color:#999999;">• </span>%s', processedLink) isFirstToken = false end table.insert(tokens, processedLink) else -- Consume regular word/chunk up to the next wikilink or whitespace local nextLink = mw.ustring.find(text, "%[%[", pos) local nextSpace = mw.ustring.find(text, "%s", pos) local endChunk = textLen if nextLink and nextSpace then endChunk = math.min(nextLink - 1, nextSpace) elseif nextLink then endChunk = nextLink - 1 elseif nextSpace then endChunk = nextSpace - 1 end local token = mw.ustring.sub(text, pos, endChunk) pos = endChunk + 1 if token ~= "" then if mw.ustring.match(token, "^[%p]+$") then local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end -- Consume following whitespace block if present local startSpace, endSpace = mw.ustring.find(text, "^%s+", pos) if startSpace then local spaceChunk = mw.ustring.sub(text, startSpace, endSpace) table.insert(tokens, spaceChunk) pos = endSpace + 1 end end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] local addBullet = not (args["enginn depill"] or args["enginn_depill"]) if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) math.randomseed(os.time()) local randomNumber = math.random(1, 100000) return frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber, processedLitill, processedMargur } } else return processText(text, lang, args, currentPage, addBullet) end end return p 2np8zyenprdz7sk0gj0jta8sozyl0cf 392404 392403 2026-08-29T06:01:01Z Ow! That Hurts! 8952 392404 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true local pos = 1 local textLen = mw.ustring.len(text) while pos <= textLen do -- Check if we are at the start of a wikilink local startLink, endLink = mw.ustring.find(text, "^%[%[.-%]%]", pos) if startLink then local innerLink = mw.ustring.sub(text, startLink, endLink) pos = endLink + 1 -- Safe extraction of target and display for [[target#anchor|display]] or [[target]] local linkTarget = "" local linkDisplay = "" local pipePos = mw.ustring.find(innerLink, "|", 1, true) if pipePos then linkTarget = mw.ustring.sub(innerLink, 3, pipePos - 1) linkDisplay = mw.ustring.sub(innerLink, pipePos + 1, mw.ustring.len(innerLink) - 2) else linkTarget = mw.ustring.sub(innerLink, 3, mw.ustring.len(innerLink) - 2) linkDisplay = linkTarget end -- Extract pure target ignoring anchors (e.g., von der Hagen#Þýska -> von der Hagen) local hashPos = mw.ustring.find(linkTarget, "#", 1, true) local pureTarget = hashPos and mw.ustring.sub(linkTarget, 1, hashPos - 1) or linkTarget local isPageMatch = pureTarget and (mw.ustring.lower(pureTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else -- Preserve custom display casing while applying grey style processedLink = string.format('[[%s|<span style="color:#999999;">%s</span>]]', linkTarget, linkDisplay) end if isFirstToken and addBullet then processedLink = string.format('<span style="color:#999999;">• </span>%s', processedLink) isFirstToken = false end table.insert(tokens, processedLink) else -- Consume regular word/chunk up to the next wikilink or whitespace local nextLink = mw.ustring.find(text, "%[%[", pos) local nextSpace = mw.ustring.find(text, "%s", pos) local endChunk = textLen if nextLink and nextSpace then endChunk = math.min(nextLink - 1, nextSpace) elseif nextLink then endChunk = nextLink - 1 elseif nextSpace then endChunk = nextSpace - 1 end local token = mw.ustring.sub(text, pos, endChunk) pos = endChunk + 1 if token ~= "" then if mw.ustring.match(token, "^[%p]+$") then local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end -- Consume following whitespace block if present local startSpace, endSpace = mw.ustring.find(text, "^%s+", pos) if startSpace then local spaceChunk = mw.ustring.sub(text, startSpace, endSpace) table.insert(tokens, spaceChunk) pos = endSpace + 1 end end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] local addBullet = not (args["enginn depill"] or args["enginn_depill"]) if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) math.randomseed(os.time()) local randomNumber = math.random(1, 100000) return frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber, processedLitill, processedMargur } } else return processText(text, lang, args, currentPage, addBullet) end end return p gtofz396omkvvhucq867hz7t5lyzbgm 392405 392404 2026-08-29T06:01:41Z Ow! That Hurts! 8952 392405 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true local pos = 1 local textLen = mw.ustring.len(text) while pos <= textLen do -- Check if we are at the start of a wikilink local startLink, endLink = mw.ustring.find(text, "^%[%[.-%]%]", pos) if startLink then local innerLink = mw.ustring.sub(text, startLink, endLink) pos = endLink + 1 local linkTarget = "" local linkDisplay = "" local pipePos = mw.ustring.find(innerLink, "|", 1, true) if pipePos then linkTarget = mw.ustring.sub(innerLink, 3, pipePos - 1) linkDisplay = mw.ustring.sub(innerLink, pipePos + 1, mw.ustring.len(innerLink) - 2) else linkTarget = mw.ustring.sub(innerLink, 3, mw.ustring.len(innerLink) - 2) linkDisplay = linkTarget end -- If pipe syntax was used like [[hvað|Hvað]], linkDisplay might be empty if miscalculated or if target had no display. -- Fallback linkDisplay to linkTarget if it's empty or whitespace only. if not linkDisplay or mw.ustring.match(linkDisplay, "^%s*$") then linkDisplay = linkTarget end local hashPos = mw.ustring.find(linkTarget, "#", 1, true) local pureTarget = hashPos and mw.ustring.sub(linkTarget, 1, hashPos - 1) or linkTarget local isPageMatch = pureTarget and (mw.ustring.lower(pureTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else processedLink = string.format('[[%s|<span style="color:#999999;">%s</span>]]', linkTarget, linkDisplay) end if isFirstToken and addBullet then processedLink = string.format('<span style="color:#999999;">• </span>%s', processedLink) isFirstToken = false end table.insert(tokens, processedLink) else -- Consume regular word/chunk up to the next wikilink or whitespace local nextLink = mw.ustring.find(text, "%[%[", pos) local nextSpace = mw.ustring.find(text, "%s", pos) local endChunk = textLen if nextLink and nextSpace then endChunk = math.min(nextLink - 1, nextSpace) elseif nextLink then endChunk = nextLink - 1 elseif nextSpace then endChunk = nextSpace - 1 end local token = mw.ustring.sub(text, pos, endChunk) pos = endChunk + 1 if token ~= "" then if mw.ustring.match(token, "^[%p]+$") then local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end -- Consume following whitespace block if present local startSpace, endSpace = mw.ustring.find(text, "^%s+", pos) if startSpace then local spaceChunk = mw.ustring.sub(text, startSpace, endSpace) table.insert(tokens, spaceChunk) pos = endSpace + 1 end end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] local addBullet = not (args["enginn depill"] or args["enginn_depill"]) if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) math.randomseed(os.time()) local randomNumber = math.random(1, 100000) return frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber, processedLitill, processedMargur } } else return processText(text, lang, args, currentPage, addBullet) end end return p 27a9q894lb55t622oma7b15fln8wiql 392406 392405 2026-08-29T06:03:26Z Ow! That Hurts! 8952 392406 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true local pos = 1 local textLen = mw.ustring.len(text) while pos <= textLen do -- Check if we are at the start of a wikilink local startLink, endLink = mw.ustring.find(text, "^%[%[.-%]%]", pos) if startLink then local innerLink = mw.ustring.sub(text, startLink, endLink) pos = endLink + 1 local linkTarget = "" local linkDisplay = "" -- Find the pipe character inside the inner link content (excluding outer [[ and ]]) local content = mw.ustring.sub(innerLink, 3, mw.ustring.len(innerLink) - 2) local pipePos = mw.ustring.find(content, "|", 1, true) if pipePos then linkTarget = mw.ustring.sub(content, 1, pipePos - 1) linkDisplay = mw.ustring.sub(content, pipePos + 1) else linkTarget = content linkDisplay = linkTarget end if not linkDisplay or mw.ustring.match(linkDisplay, "^%s*$") then linkDisplay = linkTarget end local hashPos = mw.ustring.find(linkTarget, "#", 1, true) local pureTarget = hashPos and mw.ustring.sub(linkTarget, 1, hashPos - 1) or linkTarget local isPageMatch = pureTarget and (mw.ustring.lower(pureTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else processedLink = string.format('[[%s|<span style="color:#999999;">%s</span>]]', linkTarget, linkDisplay) end if isFirstToken and addBullet then processedLink = string.format('<span style="color:#999999;">• </span>%s', processedLink) isFirstToken = false end table.insert(tokens, processedLink) else -- Consume regular word/chunk up to the next wikilink or whitespace local nextLink = mw.ustring.find(text, "%[%[", pos) local nextSpace = mw.ustring.find(text, "%s", pos) local endChunk = textLen if nextLink and nextSpace then endChunk = math.min(nextLink - 1, nextSpace) elseif nextLink then endChunk = nextLink - 1 elseif nextSpace then endChunk = nextSpace - 1 end local token = mw.ustring.sub(text, pos, endChunk) pos = endChunk + 1 if token ~= "" then if mw.ustring.match(token, "^[%p]+$") then local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end -- Consume following whitespace block if present local startSpace, endSpace = mw.ustring.find(text, "^%s+", pos) if startSpace then local spaceChunk = mw.ustring.sub(text, startSpace, endSpace) table.insert(tokens, spaceChunk) pos = endSpace + 1 end end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] local addBullet = not (args["enginn depill"] or args["enginn_depill"]) if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) math.randomseed(os.time()) local randomNumber = math.random(1, 100000) return frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber, processedLitill, processedMargur } } else return processText(text, lang, args, currentPage, addBullet) end end return p gdz8hl7phbsq1lxpzi9xfqyv7ka96w5 392407 392406 2026-08-29T06:04:41Z Ow! That Hurts! 8952 392407 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true local pos = 1 local textLen = mw.ustring.len(text) while pos <= textLen do -- Check if we are at the start of a wikilink local startLink, endLink = mw.ustring.find(text, "^%[%[.-%]%]", pos) if startLink then local innerLink = mw.ustring.sub(text, startLink, endLink) pos = endLink + 1 local linkTarget = "" local linkDisplay = "" local content = mw.ustring.sub(innerLink, 3, mw.ustring.len(innerLink) - 2) local pipePos = mw.ustring.find(content, "|", 1, true) if pipePos then linkTarget = mw.ustring.sub(content, 1, pipePos - 1) linkDisplay = mw.ustring.sub(content, pipePos + 1) else linkTarget = content linkDisplay = linkTarget end if not linkDisplay or mw.ustring.match(linkDisplay, "^%s*$") then linkDisplay = linkTarget end -- Strip anchors for page comparison local hashPos = mw.ustring.find(linkTarget, "#", 1, true) local pureTarget = hashPos and mw.ustring.sub(linkTarget, 1, hashPos - 1) or linkTarget local isPageMatch = pureTarget and (mw.ustring.lower(pureTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else -- FIX: Use linkTarget correctly instead of pulling uninitialized variables processedLink = string.format('[[%s|<span style="color:#999999;">%s</span>]]', linkTarget, linkDisplay) end if isFirstToken and addBullet then processedLink = string.format('<span style="color:#999999;">• </span>%s', processedLink) isFirstToken = false end table.insert(tokens, processedLink) else -- Consume regular word/chunk up to the next wikilink or whitespace local nextLink = mw.ustring.find(text, "%[%[", pos) local nextSpace = mw.ustring.find(text, "%s", pos) local endChunk = textLen if nextLink and nextSpace then endChunk = math.min(nextLink - 1, nextSpace) elseif nextLink then endChunk = nextLink - 1 elseif nextSpace then endChunk = nextSpace - 1 end local token = mw.ustring.sub(text, pos, endChunk) pos = endChunk + 1 if token ~= "" then if mw.ustring.match(token, "^[%p]+$") then local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end -- Consume following whitespace block if present local startSpace, endSpace = mw.ustring.find(text, "^%s+", pos) if startSpace then local spaceChunk = mw.ustring.sub(text, startSpace, endSpace) table.insert(tokens, spaceChunk) pos = endSpace + 1 end end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] local addBullet = not (args["enginn depill"] or args["enginn_depill"]) if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) math.randomseed(os.time()) local randomNumber = math.random(1, 100000) return frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber, processedLitill, processedMargur } } else return processText(text, lang, args, currentPage, addBullet) end end return p 0xo209mzawbgw0gd6crg7u8gyeceo8f 392408 392407 2026-08-29T06:09:05Z Ow! That Hurts! 8952 392408 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true local pos = 1 local textLen = mw.ustring.len(text) while pos <= textLen do -- 1. Check for leading whitespace at the current position local wsStart, wsEnd = mw.ustring.find(text, "%s+", pos) if wsStart == pos then table.insert(tokens, mw.ustring.sub(text, wsStart, wsEnd)) pos = wsEnd + 1 end if pos > textLen then break end -- 2. Check for a wikilink explicitly starting at the current position local linkStart, linkEnd = mw.ustring.find(text, "%[%[.-%]%]", pos) if linkStart == pos then local innerLink = mw.ustring.sub(text, linkStart, linkEnd) pos = linkEnd + 1 local content = mw.ustring.sub(innerLink, 3, -3) -- strip [[ and ]] local linkTarget = "" local linkDisplay = "" local pipePos = mw.ustring.find(content, "|", 1, true) if pipePos then linkTarget = mw.ustring.sub(content, 1, pipePos - 1) linkDisplay = mw.ustring.sub(content, pipePos + 1) else linkTarget = content linkDisplay = content end -- Fallback if display part is accidentally empty if not linkDisplay or mw.ustring.match(linkDisplay, "^%s*$") then linkDisplay = linkTarget end -- Strip anchors to check if it points to the current page local hashPos = mw.ustring.find(linkTarget, "#", 1, true) local pureTarget = hashPos and mw.ustring.sub(linkTarget, 1, hashPos - 1) or linkTarget local isPageMatch = pureTarget and (mw.ustring.lower(pureTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else processedLink = string.format('[[%s|<span style="color:#999999;">%s</span>]]', linkTarget, linkDisplay) end if isFirstToken and addBullet then processedLink = string.format('<span style="color:#999999;">• </span>%s', processedLink) isFirstToken = false end table.insert(tokens, processedLink) else -- 3. Consume regular word/chunk up to the next space or wikilink local nextSpace = mw.ustring.find(text, "%s+", pos) local nextLink = mw.ustring.find(text, "%[%[", pos) local endPos = textLen if nextSpace and nextLink then endPos = math.min(nextSpace, nextLink) - 1 elseif nextSpace then endPos = nextSpace - 1 elseif nextLink then endPos = nextLink - 1 end -- Fallback against infinite loop if endPos < pos then endPos = pos end local token = mw.ustring.sub(text, pos, endPos) pos = endPos + 1 if token ~= "" then if mw.ustring.match(token, "^[%p]+$") then local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] -- Safely determine target (ensure no empty strings map back to the template/current page) local target = args[coreWord .. "_" .. index] if not target or target == "" then target = args[coreWord] end if not target or target == "" then target = coreWord end local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang and lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] local addBullet = not (args["enginn depill"] or args["enginn_depill"]) if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) math.randomseed(os.time()) local randomNumber = math.random(1, 100000) return frame:expandTemplate{ title = "stutt tilvitnun", args = { [1] = randomNumber, [2] = processedLitill, [3] = processedMargur, -- Providing named fallbacks prevents the template from skipping passed parameters ["lítill"] = processedLitill, ["margur"] = processedMargur } } else return processText(text, lang, args, currentPage, addBullet) end end return p od6g9ugh1hltmjjg6kgx4psyvyuhw9d 392411 392408 2026-08-29T06:14:14Z Ow! That Hurts! 8952 392411 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if type(str) ~= "string" or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if type(text) ~= "string" or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true local pos = 1 local textLen = mw.ustring.len(text) while pos <= textLen do -- 1. Safely consume leading whitespace at the current position local wsStart, wsEnd = mw.ustring.find(text, "%s+", pos) if wsStart == pos then table.insert(tokens, mw.ustring.sub(text, wsStart, wsEnd)) pos = wsEnd + 1 end if pos > textLen then break end -- 2. Check for an explicit wikilink starting at the current position local linkStart, linkEnd = mw.ustring.find(text, "%[%[.-%]%]", pos) if linkStart == pos then local innerLink = mw.ustring.sub(text, linkStart, linkEnd) pos = linkEnd + 1 local content = mw.ustring.sub(innerLink, 3, -3) -- strip [[ and ]] local linkTarget = "" local linkDisplay = "" local pipePos = mw.ustring.find(content, "|", 1, true) if pipePos then linkTarget = mw.ustring.sub(content, 1, pipePos - 1) linkDisplay = mw.ustring.sub(content, pipePos + 1) else linkTarget = content linkDisplay = content end -- Fallback if the display text is completely empty (e.g. [[hvað| ]]) if mw.text.trim(linkDisplay) == "" then linkDisplay = linkTarget end -- Strip anchors to check if it points to the current page local hashPos = mw.ustring.find(linkTarget, "#", 1, true) local pureTarget = hashPos and mw.ustring.sub(linkTarget, 1, hashPos - 1) or linkTarget local isPageMatch = pureTarget and (mw.ustring.lower(mw.text.trim(pureTarget)) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else -- Output clean wikilink (avoids breaking parser with nested spans) processedLink = string.format('[[%s|%s]]', linkTarget, linkDisplay) end if isFirstToken and addBullet then processedLink = string.format('<span style="color:#999999;">• </span>%s', processedLink) isFirstToken = false end table.insert(tokens, processedLink) else -- 3. Consume regular word/chunk up to the next space or wikilink local nextSpace = mw.ustring.find(text, "%s", pos) local nextLink = mw.ustring.find(text, "%[%[", pos) local endPos = textLen if nextSpace and nextLink then endPos = math.min(nextSpace, nextLink) - 1 elseif nextSpace then endPos = nextSpace - 1 elseif nextLink then endPos = nextLink - 1 end -- Failsafe against infinite loop if endPos < pos then endPos = pos end local token = mw.ustring.sub(text, pos, endPos) pos = endPos + 1 if token ~= "" then if mw.ustring.match(token, "^[%p]+$") then local puncToken = token if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if mw.text.trim(coreWord) == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] -- Guaranteed safety against blank targets linking to the template itself local target = args[coreWord .. "_" .. index] if type(target) ~= "string" or mw.text.trim(target) == "" then target = args[coreWord] end if type(target) ~= "string" or mw.text.trim(target) == "" then target = coreWord end local isPageMatch = (mw.ustring.lower(mw.text.trim(target)) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang and mw.text.trim(lang) ~= "" then local capitalizedLang = capitalizeFirst(mw.text.trim(lang)) processedWord = string.format('[[%s#%s|%s]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|%s]]', target, coreWord) end end local finalFormatted = leadingPunct .. processedWord .. trailingPunct if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if mw.text.trim(text) == "" then text = args[1] or "" lang = "" end if mw.text.trim(text) == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] local addBullet = not (args["enginn depill"] or args["enginn_depill"]) if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) math.randomseed(os.time()) local randomNumber = math.random(1, 100000) return frame:expandTemplate{ title = "stutt tilvitnun", args = { [1] = tostring(randomNumber), [2] = processedLitill, [3] = processedMargur, ["lítill"] = processedLitill, ["margur"] = processedMargur } } else return processText(text, lang, args, currentPage, addBullet) end end return p 3wzzgt3vstyjcr340uf1t5tk5fhzd47 392412 392411 2026-08-29T06:16:03Z Ow! That Hurts! 8952 Afturkallaði útgáfu [[Special:Diff/392411|392411]] frá [[Special:Contributions/Ow! That Hurts!|Ow! That Hurts!]] ([[User talk:Ow! That Hurts!|spjall]]) 392412 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true local pos = 1 local textLen = mw.ustring.len(text) while pos <= textLen do -- 1. Check for leading whitespace at the current position local wsStart, wsEnd = mw.ustring.find(text, "%s+", pos) if wsStart == pos then table.insert(tokens, mw.ustring.sub(text, wsStart, wsEnd)) pos = wsEnd + 1 end if pos > textLen then break end -- 2. Check for a wikilink explicitly starting at the current position local linkStart, linkEnd = mw.ustring.find(text, "%[%[.-%]%]", pos) if linkStart == pos then local innerLink = mw.ustring.sub(text, linkStart, linkEnd) pos = linkEnd + 1 local content = mw.ustring.sub(innerLink, 3, -3) -- strip [[ and ]] local linkTarget = "" local linkDisplay = "" local pipePos = mw.ustring.find(content, "|", 1, true) if pipePos then linkTarget = mw.ustring.sub(content, 1, pipePos - 1) linkDisplay = mw.ustring.sub(content, pipePos + 1) else linkTarget = content linkDisplay = content end -- Fallback if display part is accidentally empty if not linkDisplay or mw.ustring.match(linkDisplay, "^%s*$") then linkDisplay = linkTarget end -- Strip anchors to check if it points to the current page local hashPos = mw.ustring.find(linkTarget, "#", 1, true) local pureTarget = hashPos and mw.ustring.sub(linkTarget, 1, hashPos - 1) or linkTarget local isPageMatch = pureTarget and (mw.ustring.lower(pureTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else processedLink = string.format('[[%s|<span style="color:#999999;">%s</span>]]', linkTarget, linkDisplay) end if isFirstToken and addBullet then processedLink = string.format('<span style="color:#999999;">• </span>%s', processedLink) isFirstToken = false end table.insert(tokens, processedLink) else -- 3. Consume regular word/chunk up to the next space or wikilink local nextSpace = mw.ustring.find(text, "%s+", pos) local nextLink = mw.ustring.find(text, "%[%[", pos) local endPos = textLen if nextSpace and nextLink then endPos = math.min(nextSpace, nextLink) - 1 elseif nextSpace then endPos = nextSpace - 1 elseif nextLink then endPos = nextLink - 1 end -- Fallback against infinite loop if endPos < pos then endPos = pos end local token = mw.ustring.sub(text, pos, endPos) pos = endPos + 1 if token ~= "" then if mw.ustring.match(token, "^[%p]+$") then local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] -- Safely determine target (ensure no empty strings map back to the template/current page) local target = args[coreWord .. "_" .. index] if not target or target == "" then target = args[coreWord] end if not target or target == "" then target = coreWord end local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang and lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] local addBullet = not (args["enginn depill"] or args["enginn_depill"]) if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) math.randomseed(os.time()) local randomNumber = math.random(1, 100000) return frame:expandTemplate{ title = "stutt tilvitnun", args = { [1] = randomNumber, [2] = processedLitill, [3] = processedMargur, -- Providing named fallbacks prevents the template from skipping passed parameters ["lítill"] = processedLitill, ["margur"] = processedMargur } } else return processText(text, lang, args, currentPage, addBullet) end end return p od6g9ugh1hltmjjg6kgx4psyvyuhw9d 392413 392412 2026-08-29T06:18:00Z Ow! That Hurts! 8952 392413 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if type(str) ~= "string" or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if type(text) ~= "string" or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true local pos = 1 local textLen = mw.ustring.len(text) while pos <= textLen do -- 1. Safely consume leading whitespace at the current position local wsStart, wsEnd = mw.ustring.find(text, "%s+", pos) if wsStart == pos then table.insert(tokens, mw.ustring.sub(text, wsStart, wsEnd)) pos = wsEnd + 1 end if pos > textLen then break end -- 2. Check for an explicit wikilink starting at the current position local linkStart, linkEnd = mw.ustring.find(text, "%[%[.-%]%]", pos) if linkStart == pos then local innerLink = mw.ustring.sub(text, linkStart, linkEnd) pos = linkEnd + 1 local content = mw.ustring.sub(innerLink, 3, -3) -- strip [[ and ]] local linkTarget = "" local linkDisplay = "" local pipePos = mw.ustring.find(content, "|", 1, true) if pipePos then linkTarget = mw.ustring.sub(content, 1, pipePos - 1) linkDisplay = mw.ustring.sub(content, pipePos + 1) else linkTarget = content linkDisplay = content end -- Fallback if the display text is completely empty (e.g. [[hvað| ]]) if mw.text.trim(linkDisplay) == "" then linkDisplay = linkTarget end -- Strip anchors to check if it points to the current page local hashPos = mw.ustring.find(linkTarget, "#", 1, true) local pureTarget = hashPos and mw.ustring.sub(linkTarget, 1, hashPos - 1) or linkTarget local isPageMatch = pureTarget and (mw.ustring.lower(mw.text.trim(pureTarget)) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else -- Apply grey color INSIDE the link display text processedLink = string.format('[[%s|<span style="color:#999999;">%s</span>]]', linkTarget, linkDisplay) end if isFirstToken and addBullet then processedLink = string.format('<span style="color:#999999;">• </span>%s', processedLink) isFirstToken = false end table.insert(tokens, processedLink) else -- 3. Consume regular word/chunk up to the next space or wikilink local nextSpace = mw.ustring.find(text, "%s", pos) local nextLink = mw.ustring.find(text, "%[%[", pos) local endPos = textLen if nextSpace and nextLink then endPos = math.min(nextSpace, nextLink) - 1 elseif nextSpace then endPos = nextSpace - 1 elseif nextLink then endPos = nextLink - 1 end -- Failsafe against infinite loop if endPos < pos then endPos = pos end local token = mw.ustring.sub(text, pos, endPos) pos = endPos + 1 if token ~= "" then if mw.ustring.match(token, "^[%p]+$") then local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if mw.text.trim(coreWord) == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] -- Guaranteed safety against blank targets linking to the template itself local target = args[coreWord .. "_" .. index] if type(target) ~= "string" or mw.text.trim(target) == "" then target = args[coreWord] end if type(target) ~= "string" or mw.text.trim(target) == "" then target = coreWord end local isPageMatch = (mw.ustring.lower(mw.text.trim(target)) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang and mw.text.trim(lang) ~= "" then local capitalizedLang = capitalizeFirst(mw.text.trim(lang)) -- Apply grey color INSIDE the link display text processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else -- Apply grey color INSIDE the link display text processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if mw.text.trim(text) == "" then text = args[1] or "" lang = "" end if mw.text.trim(text) == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] local addBullet = not (args["enginn depill"] or args["enginn_depill"]) if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) math.randomseed(os.time()) local randomNumber = math.random(1, 100000) return frame:expandTemplate{ title = "stutt tilvitnun", args = { [1] = tostring(randomNumber), [2] = processedLitill, [3] = processedMargur, ["lítill"] = processedLitill, ["margur"] = processedMargur } } else return processText(text, lang, args, currentPage, addBullet) end end return p t4i3w3lxqqkfntf8o8wkq0l3s0d9mx9 392419 392413 2026-08-29T07:39:37Z Ow! That Hurts! 8952 392419 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true for chunk in string.gmatch(text, "%S+%s*") do local token, space = string.match(chunk, "^(%S+)(%s*)$") if token then local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then formattedToken = string.format('<span style="color:#999999;">• </span>%s', formattedToken) isFirstToken = false end table.insert(tokens, formattedToken) else if mw.ustring.match(token, "^[%p]+$") then local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end else table.insert(tokens, chunk) end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] local addBullet = not (args["enginn depill"] or args["enginn_depill"]) if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) -- Preprocess the #invoke call to safely execute Module:slembitölugjafi. -- If the target module uses a function name other than "main" (like "random"), change "main" below to match it. local randomNumber = frame:preprocess('{{#invoke:slembitölugjafi|main}}') return frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber, processedLitill, processedMargur } } else return processText(text, lang, args, currentPage, addBullet) end end return p 6jxtn5jid0zdnc1ftfi9abmf9u07ha7 392425 392419 2026-08-29T08:49:55Z Ow! That Hurts! 8952 392425 Scribunto text/plain local p = {} -- Helper function to capitalize the first letter of a string safely using mw.ustring local function capitalizeFirst(str) if not str or str == "" then return "" end local first = mw.ustring.upper(mw.ustring.sub(str, 1, 1)) local rest = mw.ustring.sub(str, 2) return first .. rest end -- Helper function to process a text passage into linked/bolded tokens local function processText(text, lang, args, currentPage, addBullet) if not text or text == "" then return "" end local wordCounts = {} local tokens = {} local isFirstToken = true -- Phase 1: Group chunks together if they are inside a wikilink (to support multi-word links) local rawChunks = {} local currentToken = "" local inLink = false for chunk in string.gmatch(text, "%S+%s*") do if not inLink then local opens = select(2, string.gsub(chunk, "%[%[", "")) local closes = select(2, string.gsub(chunk, "%]%]", "")) if opens > closes then inLink = true currentToken = chunk else table.insert(rawChunks, chunk) end else currentToken = currentToken .. chunk local opens = select(2, string.gsub(currentToken, "%[%[", "")) local closes = select(2, string.gsub(currentToken, "%]%]", "")) if closes >= opens then inLink = false table.insert(rawChunks, currentToken) currentToken = "" end end end if inLink then table.insert(rawChunks, currentToken) end -- Phase 2: Process the collected tokens for _, chunk in ipairs(rawChunks) do -- Extract the token and any trailing spaces attached to it local token, space = string.match(chunk, "^(.-)(%s*)$") if token and token ~= "" then local leadingPunct, innerLink, trailingPunct = mw.ustring.match(token, "^(.-)(%[%[.+%]%])(.-)$") if innerLink and innerLink ~= "" then local linkTarget, linkDisplay = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%|([^%|%]]+)%]$") if not linkTarget then linkTarget = mw.ustring.match(innerLink, "^%[%[([^%|%]]+)%]$") linkDisplay = linkTarget end local isPageMatch = linkTarget and (mw.ustring.lower(linkTarget) == mw.ustring.lower(currentPage)) local processedLink = "" if isPageMatch then processedLink = string.format('<strong style="color:#999999;">%s</strong>', linkDisplay) else local formatted = mw.ustring.gsub(innerLink, "%|([^%|%]]+)%]%]", '|<span style="color:#999999;">%1</span>]]') if formatted == innerLink then formatted = mw.ustring.gsub(innerLink, "%[%[([^%|%]]+)%]%]", '[[%1|<span style="color:#999999;">%1</span>]]') end processedLink = formatted end local formattedToken = "" if leadingPunct and leadingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end formattedToken = formattedToken .. processedLink if trailingPunct and trailingPunct ~= "" then formattedToken = formattedToken .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then formattedToken = string.format('<span style="color:#999999;">• </span>%s', formattedToken) isFirstToken = false end table.insert(tokens, formattedToken) else if mw.ustring.match(token, "^[%p]+$") then local puncToken = string.format('<span style="color:#999999;">%s</span>', token) if isFirstToken and addBullet then puncToken = string.format('<span style="color:#999999;">• </span>%s', puncToken) isFirstToken = false end table.insert(tokens, puncToken) else local leadingPunct = mw.ustring.match(token, "^([%p]+)") or "" local trailingPunct = mw.ustring.match(token, "([%p]+)$") or "" local coreWord = token if leadingPunct ~= "" then coreWord = mw.ustring.sub(coreWord, mw.ustring.len(leadingPunct) + 1) end if trailingPunct ~= "" and mw.ustring.len(coreWord) >= mw.ustring.len(trailingPunct) then coreWord = mw.ustring.sub(coreWord, 1, mw.ustring.len(coreWord) - mw.ustring.len(trailingPunct)) end if not coreWord or coreWord == "" then coreWord = token leadingPunct = "" trailingPunct = "" end wordCounts[coreWord] = (wordCounts[coreWord] or 0) + 1 local index = wordCounts[coreWord] local target = args[coreWord .. "_" .. index] or args[coreWord] or coreWord local isPageMatch = (mw.ustring.lower(target) == mw.ustring.lower(currentPage)) local processedWord = "" if isPageMatch then processedWord = string.format('<strong style="color:#999999;">%s</strong>', coreWord) else if lang ~= "" then local capitalizedLang = capitalizeFirst(lang) processedWord = string.format('[[%s#%s|<span style="color:#999999;">%s</span>]]', target, capitalizedLang, coreWord) else processedWord = string.format('[[%s|<span style="color:#999999;">%s</span>]]', target, coreWord) end end local finalFormatted = "" if leadingPunct and leadingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', leadingPunct) end finalFormatted = finalFormatted .. processedWord if trailingPunct and trailingPunct ~= "" then finalFormatted = finalFormatted .. string.format('<span style="color:#999999;">%s</span>', trailingPunct) end if isFirstToken and addBullet then finalFormatted = string.format('<span style="color:#999999;">• </span>%s', finalFormatted) isFirstToken = false end table.insert(tokens, finalFormatted) end end if space and space ~= "" then table.insert(tokens, space) end elseif space and space ~= "" then table.insert(tokens, space) end end return table.concat(tokens) end function p.main(frame) local args = frame:getParent().args local lang = args[1] or "" local text = args[2] or "" if text == "" then text = args[1] or "" lang = "" end if text == "" then return "" end local currentPage = mw.title.getCurrentTitle().text local litillText = args["litill"] or args["lítill"] local margurText = args["margur"] local addBullet = not (args["enginn depill"] or args["enginn_depill"]) if litillText or margurText then local processedLitill = processText(litillText, lang, args, currentPage, addBullet) local processedMargur = processText(margurText, lang, args, currentPage, addBullet) -- Preprocess the #invoke call to safely execute Module:slembitölugjafi. local randomNumber = frame:preprocess('{{#invoke:slembitölugjafi|main}}') return frame:expandTemplate{ title = "stutt tilvitnun", args = { randomNumber, processedLitill, processedMargur } } else return processText(text, lang, args, currentPage, addBullet) end end return p ieujb5n3biou3gkmbuhcc0t20iouqdm Snið:tilvitnun 10 118911 392350 2026-08-29T02:42:41Z Ow! That Hurts! 8952 Bjó til síðu með „{{#invoke:tilvitnun|main|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|{{{5|}}}|{{{6|}}}|{{{7|}}}|{{{8|}}}|{{{9|}}}|{{{10|}}}|2b={{{2b|}}}|3b={{{3b|}}}|4b={{{4b|}}}|5b={{{5b|}}}|6b={{{6b|}}}|7b={{{7b|}}}|8b={{{8b|}}}|9b={{{9b|}}}|10b={{{10b|}}}|f2={{{f2|}}}|f3={{{f3|}}}|f4={{{f4|}}}|f5={{{f5|}}}|f6={{{f6|}}}|f7={{{f7|}}}|f8={{{f8|}}}|f9={{{f9|}}}|f10={{{f10|}}}|e2={{{e2|}}}|e3={{{e3|}}}|e4={{{e4|}}}|e5={{{e5|}}}|e6={{{e6|}}}|e7={{{e7|}}}|e8={{{e8|}}}|e9={{{e9|}}}|e10={{{e10...“ 392350 wikitext text/x-wiki {{#invoke:tilvitnun|main|{{{1|}}}|{{{2|}}}|{{{3|}}}|{{{4|}}}|{{{5|}}}|{{{6|}}}|{{{7|}}}|{{{8|}}}|{{{9|}}}|{{{10|}}}|2b={{{2b|}}}|3b={{{3b|}}}|4b={{{4b|}}}|5b={{{5b|}}}|6b={{{6b|}}}|7b={{{7b|}}}|8b={{{8b|}}}|9b={{{9b|}}}|10b={{{10b|}}}|f2={{{f2|}}}|f3={{{f3|}}}|f4={{{f4|}}}|f5={{{f5|}}}|f6={{{f6|}}}|f7={{{f7|}}}|f8={{{f8|}}}|f9={{{f9|}}}|f10={{{f10|}}}|e2={{{e2|}}}|e3={{{e3|}}}|e4={{{e4|}}}|e5={{{e5|}}}|e6={{{e6|}}}|e7={{{e7|}}}|e8={{{e8|}}}|e9={{{e9|}}}|e10={{{e10|}}}}} {{#if:{{{enginn depill|}}}||{{litur|#999999|• }}}}{{#if:{{{f2|}}}|{{litur|#999999|{{{f2}}}}}}}[[{{{2}}}#{{uc:{{{1}}}}}|{{litur|#999999|{{{2b|{{{2}}}}}}}}]]{{#if:{{{e2|}}}|{{litur|#999999|{{{e2}}}}}}} {{#if:{{{3|}}}|[[{{{3}}}#{{uc:{{{1}}}}}|{{litur|#999999|{{{3b|{{{3}}}}}}}}]]}} <noinclude> ===Breytur=== <code><nowiki>{{{1}}}</nowiki></code> — tungumálakóði <code><nowiki>{{{enginn depill}}}</nowiki></code> — textinn sem birtist áður en ýtt er á hann <code><nowiki>{{{2}}}</nowiki></code>, <code><nowiki>{{{3}}}</nowiki></code>, <code><nowiki>{{{4}}}</nowiki></code>, o.fl. — hvert orð, slegið inn fyrir sig (upp í 1000) <code><nowiki>{{{2b}}}</nowiki></code>, <code><nowiki>{{{3b}}}</nowiki></code>, <code><nowiki>{{{4b}}}</nowiki></code>, o.fl. — birtir annan texta fyrir hvert orð (upp í 1000) <code><nowiki>{{{f2}}}</nowiki></code>, <code><nowiki>{{{f3}}}</nowiki></code>, <code><nowiki>{{{f4}}}</nowiki></code>, o.fl. — greinarmerki fyrir framan orð (upp í 1000) <code><nowiki>{{{e2}}}</nowiki></code>, <code><nowiki>{{{e3}}}</nowiki></code>, <code><nowiki>{{{e4}}}</nowiki></code>, o.fl. — greinarmerki eftir orð (upp í 1000) ===Dæmi=== <code><nowiki>{{tilvitnun|is|f2=„|halló|e2=“|ég|er|maður|og|ég}}</nowiki></code> {{tilvitnun|is|f2=„|halló|e2=“|ég|er|maður|og|ég}} </noinclude> frkcjspkl1eoern3c71mwrzaj0jh3rd 392380 392350 2026-08-29T04:47:16Z Ow! That Hurts! 8952 392380 wikitext text/x-wiki {{#invoke:tilvitnun|main}}<noinclude> ==Breytur== <code><nowiki>{{{1}}}</nowiki></code> — tungumálakóði <code><nowiki>{{{2}}}</nowiki></code> — texti ==Dæmi== # <code><nowiki>{{tilvitnun|is|[[hæ|Hæ]]! [[ég|Ég]] er sniðið „tilvitnun“, og þú ert?}}</nowiki></code> #: {{tilvitnun|is|[[hæ|Hæ]]! [[ég|Ég]] er sniðið „tilvitnun“, og þú ert?}} </noinclude> d0ljcihyh702j5gpmi0fgb2r3t8sams 392398 392380 2026-08-29T05:48:10Z Ow! That Hurts! 8952 392398 wikitext text/x-wiki {{#invoke:tilvitnun|main}} {{#if:{{{höfundur|}}}|{{stutt tilvitnun|{{#invoke:slembitölugjafi|main}}|{{#if:{{{höfundur|}}}|{{hástafir|{{{höfundur}}}}}{{#if:{{{árið|}}}|,}}}} {{#if:{{{árið|}}}|{{{árið}}}}}|{{#if:{{{dagsetning|}}}|{{{dagsetning}}},|{{{árið}}},}} {{#if:{{{fullur höfundur|}}}|{{hástafir|{{{fullur höfundur}}}}},|{{hástafir|{{{höfundur}}}}},}} {{{full tilvitnun}}}}}}}<noinclude> ==Breytur== <code><nowiki>{{{1}}}</nowiki></code> — tungumálakóði <code><nowiki>{{{2}}}</nowiki></code>, <code><nowiki>{{{lítill}}}</nowiki></code>, <code><nowiki>{{{margur}}}</nowiki></code> — texti <code><nowiki>{{{höfundur}}}</nowiki></code>, <code><nowiki>{{{fullur höfundur}}}</nowiki></code> <code><nowiki>{{{árið}}}</nowiki></code>, <code><nowiki>{{{dagsetning}}}</nowiki></code> <code><nowiki>{{{full tilvitnun}}}</nowiki></code> <code><nowiki>{{{engin depill}}}</nowiki></code> ==Dæmi== # <code><nowiki>{{tilvitnun|is|[[hæ|Hæ]]! [[ég|Ég]] er sniðið „tilvitnun“, og þú ert?}}</nowiki></code> #: {{tilvitnun|is|lítill=[[hæ|Hæ]]! [[ég|Ég]] er sniðið „tilvitnun“,|margur=og þú ert?|höfundur=Carl|árið=1029|dagsetning=132034|fullur höfundur=Carl Hanssen|full tilvitnun=Carl}} </noinclude> phpd1wuifqr4vxhvknz1hyc4dfquguy 392410 392398 2026-08-29T06:10:29Z Ow! That Hurts! 8952 392410 wikitext text/x-wiki {{#invoke:tilvitnun|main}} {{#if:{{{höfundur|}}}|{{stutt tilvitnun|{{#invoke:slembitölugjafi|main}}|{{#if:{{{höfundur|}}}|{{hástafir|{{{höfundur}}}}}{{#if:{{{árið|}}}|,}}}} {{#if:{{{árið|}}}|{{{árið}}}}}|{{#if:{{{dagsetning|}}}|{{{dagsetning}}},|{{{árið}}},}} {{#if:{{{fullur höfundur|}}}|{{hástafir|{{{fullur höfundur}}}}},|{{hástafir|{{{höfundur}}}}},}} {{{full tilvitnun}}}}}}}<noinclude> ==Breytur== <code><nowiki>{{{1}}}</nowiki></code> — tungumálakóði <code><nowiki>{{{2}}}</nowiki></code>, <code><nowiki>{{{lítill}}}</nowiki></code>, <code><nowiki>{{{margur}}}</nowiki></code> — texti <code><nowiki>{{{höfundur}}}</nowiki></code>, <code><nowiki>{{{fullur höfundur}}}</nowiki></code> <code><nowiki>{{{árið}}}</nowiki></code>, <code><nowiki>{{{dagsetning}}}</nowiki></code> <code><nowiki>{{{full tilvitnun}}}</nowiki></code> <code><nowiki>{{{engin depill}}}</nowiki></code> ==Dæmi== # <code><nowiki>{{tilvitnun|is|lítill=sem löguð mun verða eptir textanum|margur=[[hvað|Hvað]] mikils sögur þessar hafa í Utlöndum metnar verið, lýsir það því, meðal annars, að þó sá lærði Prófessor við Háskólann í Berlín [[von der Hagen#Þýska|von der Hagen]] árið 1814 gæfi út mikinn part þeirra á Islenzku og þýzku, hafa þær í Þýzkalandi enn svo marga vini, að hann nýlega hefir aptr boðað útgáfu þeirra á þýzka túngu, sem löguð mun verða eptir textanum í því að framan boðna sögusafni.|höfundur=[[w:Carl Christian Rafn|Rafn]]|árið=1826|dagsetning=10. apríl 1826|fullur höfundur=[[w:Carl Christian Rafn|Carl Christian Rafn]]|full tilvitnun=„Fornaldar Sögur Norðrlanda“, í ''[[w:Frétt|Frèttir]]'', [[w:Kaupmannahöfn|Kaupmannahöfn]], [https://timarit.is/page/1992949?iabr&#61;on síða 88]}}</nowiki></code> #: {{tilvitnun|is|lítill=sem löguð mun verða eptir textanum|margur=[[hvað|Hvað]] mikils sögur þessar hafa í Utlöndum metnar verið, lýsir það því, meðal annars, að þó sá lærði Prófessor við Háskólann í Berlín [[von der Hagen#Þýska|von der Hagen]] árið 1814 gæfi út mikinn part þeirra á Islenzku og þýzku, hafa þær í Þýzkalandi enn svo marga vini, að hann nýlega hefir aptr boðað útgáfu þeirra á þýzka túngu, sem löguð mun verða eptir textanum í því að framan boðna sögusafni.|höfundur=[[w:Carl Christian Rafn|Rafn]]|árið=1826|dagsetning=10. apríl 1826|fullur höfundur=[[w:Carl Christian Rafn|Carl Christian Rafn]]|full tilvitnun=„Fornaldar Sögur Norðrlanda“, í ''[[w:Frétt|Frèttir]]'', [[w:Kaupmannahöfn|Kaupmannahöfn]], [https://timarit.is/page/1992949?iabr&#61;on síða 88]}} </noinclude> bhswwfs0r1vkubohuz8y8kucucjz7c1 392420 392410 2026-08-29T08:02:58Z Ow! That Hurts! 8952 392420 wikitext text/x-wiki {{#invoke:tilvitnun|main}} {{#if:{{{höfundur|{{{höf|}}}}}}|{{stutt tilvitnun|{{#invoke:slembitölugjafi|main}}|{{#if:{{{höfundur|{{{höf|}}}}}}|{{hástafir|{{{höfundur|{{{höf}}}}}}}}{{#if:{{{árið|{{{ár|}}}}}}|,}}}} {{#if:{{{árið|{{{ár|}}}}}}|{{{árið|{{{ár}}}}}}}}|{{#if:{{{fullur höfundur|{{{fhöf|}}}}}}|{{hástafir|{{{fullur höfundur|{{{fhöf}}}}}}}}|{{hástafir|{{{höfundur|{{{höf}}}}}}}}}} {{#if:{{{dagsetning|{{{dag|}}}}}}|({{{dagsetning|{{{dag}}}}}}),|{{#if:({{{árið|{{{ár|}}}}}})}},}} {{{full tilvitnun|{{{ftil}}}}}}}}}}<noinclude> ==Breytur== <code><nowiki>{{{1}}}</nowiki></code> — tungumálakóði <code><nowiki>{{{2}}}</nowiki></code>, <code><nowiki>{{{lítill}}}</nowiki></code>, <code><nowiki>{{{margur}}}</nowiki></code> — texti <code><nowiki>{{{höfundur}}}</nowiki></code>, <code><nowiki>{{{fullur höfundur}}}</nowiki></code> <code><nowiki>{{{árið}}}</nowiki></code>, <code><nowiki>{{{dagsetning}}}</nowiki></code> <code><nowiki>{{{full tilvitnun}}}</nowiki></code> <code><nowiki>{{{engin depill}}}</nowiki></code> ==Dæmi== # <code><nowiki>{{tilvitnun|is|lítill=sem löguð mun verða eptir textanum|margur=[[hvað|Hvað]] mikils sögur þessar hafa í Utlöndum metnar verið, lýsir það því, meðal annars, að þó sá lærði Prófessor við Háskólann í Berlín [[von der Hagen#Þýska|von der Hagen]] árið 1814 gæfi út mikinn part þeirra á Islenzku og þýzku, hafa þær í Þýzkalandi enn svo marga vini, að hann nýlega hefir aptr boðað útgáfu þeirra á þýzka túngu, sem löguð mun verða eptir textanum í því að framan boðna sögusafni.|höfundur=[[w:Carl Christian Rafn|Rafn]]|árið=1826|dagsetning=10. apríl 1826|fullur höfundur=[[w:Carl Christian Rafn|Carl Christian Rafn]]|full tilvitnun=„Fornaldar Sögur Norðrlanda“, í ''[[w:Frétt|Frèttir]]'', [[w:Kaupmannahöfn|Kaupmannahöfn]], [https://timarit.is/page/1992949?iabr&#61;on síða 88]}}</nowiki></code> #: {{tilvitnun|is|lítill=sem löguð mun verða eptir textanum|margur=[[hvað|Hvað]] mikils sögur þessar hafa í Utlöndum metnar verið, lýsir það því, meðal annars, að þó sá lærði Prófessor við Háskólann í Berlín [[von der Hagen#Þýska|von der Hagen]] árið 1814 gæfi út mikinn part þeirra á Islenzku og þýzku, hafa þær í Þýzkalandi enn svo marga vini, að hann nýlega hefir aptr boðað útgáfu þeirra á þýzka túngu, sem löguð mun verða eptir textanum í því að framan boðna sögusafni.|höfundur=[[w:Carl Christian Rafn|Rafn]]|árið=1826|dagsetning=10. apríl 1826|fullur höfundur=[[w:Carl Christian Rafn|Carl Christian Rafn]]|full tilvitnun=„Fornaldar Sögur Norðrlanda“, í ''[[w:Frétt|Frèttir]]'', [[w:Kaupmannahöfn|Kaupmannahöfn]], [https://timarit.is/page/1992949?iabr&#61;on síða 88]}} </noinclude> lv06pzuu8lh6s6rqdh7qzb1dzbu9hoi 392421 392420 2026-08-29T08:04:03Z Ow! That Hurts! 8952 392421 wikitext text/x-wiki {{#invoke:tilvitnun|main}} {{#if:{{{höfundur|{{{höf|}}}}}}|{{stutt tilvitnun|{{#invoke:slembitölugjafi|main}}|{{#if:{{{höfundur|{{{höf|}}}}}}|{{hástafir|{{{höfundur|{{{höf}}}}}}}}{{#if:{{{árið|{{{ár|}}}}}}|,}}}} {{#if:{{{árið|{{{ár|}}}}}}|{{{árið|{{{ár}}}}}}}}|{{#if:{{{fullur höfundur|{{{fhöf|}}}}}}|{{hástafir|{{{fullur höfundur|{{{fhöf}}}}}}}}|{{hástafir|{{{höfundur|{{{höf}}}}}}}}}} {{#if:{{{dagsetning|{{{dag|}}}}}}|({{{dagsetning|{{{dag}}}}}}),|{{#if:({{{árið|{{{ár|}}}}}})}},}} {{{full tilvitnun|{{{ftil}}}}}}}}}}<noinclude> ==Breytur== <code><nowiki>{{{1}}}</nowiki></code> — tungumálakóði <code><nowiki>{{{2}}}</nowiki></code>, <code><nowiki>{{{lítill}}}</nowiki></code>, <code><nowiki>{{{margur}}}</nowiki></code> — texti <code><nowiki>{{{höfundur}}}</nowiki></code>, <code><nowiki>{{{höf}}}</nowiki></code>, <code><nowiki>{{{fullur höfundur}}}</nowiki></code>, <code><nowiki>{{{fhöf}}}</nowiki></code> <code><nowiki>{{{árið}}}</nowiki></code>, <code><nowiki>{{{ár}}}</nowiki></code>, <code><nowiki>{{{dagsetning}}}</nowiki></code>, <code><nowiki>{{{dag}}}</nowiki></code> <code><nowiki>{{{full tilvitnun}}}</nowiki></code>, <code><nowiki>{{{ftil}}}</nowiki></code> <code><nowiki>{{{engin depill}}}</nowiki></code> ==Dæmi== # <code><nowiki>{{tilvitnun|is|lítill=sem löguð mun verða eptir textanum|margur=[[hvað|Hvað]] mikils sögur þessar hafa í Utlöndum metnar verið, lýsir það því, meðal annars, að þó sá lærði Prófessor við Háskólann í Berlín [[von der Hagen#Þýska|von der Hagen]] árið 1814 gæfi út mikinn part þeirra á Islenzku og þýzku, hafa þær í Þýzkalandi enn svo marga vini, að hann nýlega hefir aptr boðað útgáfu þeirra á þýzka túngu, sem löguð mun verða eptir textanum í því að framan boðna sögusafni.|höfundur=[[w:Carl Christian Rafn|Rafn]]|árið=1826|dagsetning=10. apríl 1826|fullur höfundur=[[w:Carl Christian Rafn|Carl Christian Rafn]]|full tilvitnun=„Fornaldar Sögur Norðrlanda“, í ''[[w:Frétt|Frèttir]]'', [[w:Kaupmannahöfn|Kaupmannahöfn]], [https://timarit.is/page/1992949?iabr&#61;on síða 88]}}</nowiki></code> #: {{tilvitnun|is|lítill=sem löguð mun verða eptir textanum|margur=[[hvað|Hvað]] mikils sögur þessar hafa í Utlöndum metnar verið, lýsir það því, meðal annars, að þó sá lærði Prófessor við Háskólann í Berlín [[von der Hagen#Þýska|von der Hagen]] árið 1814 gæfi út mikinn part þeirra á Islenzku og þýzku, hafa þær í Þýzkalandi enn svo marga vini, að hann nýlega hefir aptr boðað útgáfu þeirra á þýzka túngu, sem löguð mun verða eptir textanum í því að framan boðna sögusafni.|höfundur=[[w:Carl Christian Rafn|Rafn]]|árið=1826|dagsetning=10. apríl 1826|fullur höfundur=[[w:Carl Christian Rafn|Carl Christian Rafn]]|full tilvitnun=„Fornaldar Sögur Norðrlanda“, í ''[[w:Frétt|Frèttir]]'', [[w:Kaupmannahöfn|Kaupmannahöfn]], [https://timarit.is/page/1992949?iabr&#61;on síða 88]}} </noinclude> s3v7nabujnxxa2hk0g2oyuv6a9rp4m9 392422 392421 2026-08-29T08:06:13Z Ow! That Hurts! 8952 392422 wikitext text/x-wiki {{#invoke:tilvitnun|main}} {{#if:{{{höfundur|{{{höf|}}}}}}|{{stutt tilvitnun|{{#invoke:slembitölugjafi|main}}|{{#if:{{{höfundur|{{{höf|}}}}}}|{{hástafir|{{{höfundur|{{{höf}}}}}}}}{{#if:{{{árið|{{{ár|}}}}}}|,}}}} {{#if:{{{árið|{{{ár|}}}}}}|{{{árið|{{{ár}}}}}}}}|{{#if:{{{fullur höfundur|{{{fhöf|}}}}}}|{{hástafir|{{{fullur höfundur|{{{fhöf}}}}}}}}|{{hástafir|{{{höfundur|{{{höf}}}}}}}}}} {{#if:{{{dagsetning|{{{dag|}}}}}}|({{{dagsetning|{{{dag}}}}}}),|{{#if:{{{árið|{{{ár|}}}}}}|({{{árið|{{{ár}}}}}})}},}} {{{full tilvitnun|{{{ftil}}}}}}}}}}<noinclude> ==Breytur== <code><nowiki>{{{1}}}</nowiki></code> — tungumálakóði <code><nowiki>{{{2}}}</nowiki></code>, <code><nowiki>{{{lítill}}}</nowiki></code>, <code><nowiki>{{{margur}}}</nowiki></code> — texti <code><nowiki>{{{höfundur}}}</nowiki></code>, <code><nowiki>{{{höf}}}</nowiki></code>, <code><nowiki>{{{fullur höfundur}}}</nowiki></code>, <code><nowiki>{{{fhöf}}}</nowiki></code> <code><nowiki>{{{árið}}}</nowiki></code>, <code><nowiki>{{{ár}}}</nowiki></code>, <code><nowiki>{{{dagsetning}}}</nowiki></code>, <code><nowiki>{{{dag}}}</nowiki></code> <code><nowiki>{{{full tilvitnun}}}</nowiki></code>, <code><nowiki>{{{ftil}}}</nowiki></code> <code><nowiki>{{{engin depill}}}</nowiki></code> ==Dæmi== # <code><nowiki>{{tilvitnun|is|lítill=sem löguð mun verða eptir textanum|margur=[[hvað|Hvað]] mikils sögur þessar hafa í Utlöndum metnar verið, lýsir það því, meðal annars, að þó sá lærði Prófessor við Háskólann í Berlín [[von der Hagen#Þýska|von der Hagen]] árið 1814 gæfi út mikinn part þeirra á Islenzku og þýzku, hafa þær í Þýzkalandi enn svo marga vini, að hann nýlega hefir aptr boðað útgáfu þeirra á þýzka túngu, sem löguð mun verða eptir textanum í því að framan boðna sögusafni.|höfundur=[[w:Carl Christian Rafn|Rafn]]|árið=1826|dagsetning=10. apríl 1826|fullur höfundur=[[w:Carl Christian Rafn|Carl Christian Rafn]]|full tilvitnun=„Fornaldar Sögur Norðrlanda“, í ''[[w:Frétt|Frèttir]]'', [[w:Kaupmannahöfn|Kaupmannahöfn]], [https://timarit.is/page/1992949?iabr&#61;on síða 88]}}</nowiki></code> #: {{tilvitnun|is|lítill=sem löguð mun verða eptir textanum|margur=[[hvað|Hvað]] mikils sögur þessar hafa í Utlöndum metnar verið, lýsir það því, meðal annars, að þó sá lærði Prófessor við Háskólann í Berlín [[von der Hagen#Þýska|von der Hagen]] árið 1814 gæfi út mikinn part þeirra á Islenzku og þýzku, hafa þær í Þýzkalandi enn svo marga vini, að hann nýlega hefir aptr boðað útgáfu þeirra á þýzka túngu, sem löguð mun verða eptir textanum í því að framan boðna sögusafni.|höfundur=[[w:Carl Christian Rafn|Rafn]]|árið=1826|dagsetning=10. apríl 1826|fullur höfundur=[[w:Carl Christian Rafn|Carl Christian Rafn]]|full tilvitnun=„Fornaldar Sögur Norðrlanda“, í ''[[w:Frétt|Frèttir]]'', [[w:Kaupmannahöfn|Kaupmannahöfn]], [https://timarit.is/page/1992949?iabr&#61;on síða 88]}} </noinclude> 8l2dccd7jyzb713xybxp18rnc6wwhgp Snið:tilvitnun/liður 10 118912 392352 2026-08-29T02:53:02Z Ow! That Hurts! 8952 Bjó til síðu með „{{#if:{{{f|}}}|{{litur|#999999|{{{f}}}}}}}[[{{{1}}}#{{uc:{{{base}}}}}|{{litur|#999999|{{{b|{{{base}}}}}}}}]]{{#if:{{{e|}}}|{{litur|#999999|{{{e}}}}}}}“ 392352 wikitext text/x-wiki {{#if:{{{f|}}}|{{litur|#999999|{{{f}}}}}}}[[{{{1}}}#{{uc:{{{base}}}}}|{{litur|#999999|{{{b|{{{base}}}}}}}}]]{{#if:{{{e|}}}|{{litur|#999999|{{{e}}}}}}} 6thagovn6qy382wdw56bkvivfn8vn2s Module:slembitölugjafi 828 118913 392394 2026-08-29T05:34:23Z Ow! That Hurts! 8952 Bjó til síðu með „-- Generate a pseudo-random number between 1 and 100 math.randomseed(os.time()) local random_number = math.random(1, 10000) print(random_number)“ 392394 Scribunto text/plain -- Generate a pseudo-random number between 1 and 100 math.randomseed(os.time()) local random_number = math.random(1, 10000) print(random_number) 31qn87o4do7r64z8krgs0ur5mcce2th 392395 392394 2026-08-29T05:36:36Z Ow! That Hurts! 8952 392395 Scribunto text/plain local p = {} function p.main(frame) -- Retrieve arguments passed from the template/invoke call local args = frame.args local arg1 = tonumber(args[1] or args.min) local arg2 = tonumber(args[2] or args.max) -- If no arguments are provided, return a float between 0 and 1 if not arg1 and not arg2 then return math.random() end -- If only one argument is provided, treat it as the upper bound (1 to n) if arg1 and not arg2 then if arg1 == 0 then return 0 elseif arg1 < 0 then return math.random(arg1, 0) else return math.random(1, arg1) end end -- If two arguments are provided, treat them as min and max bounds if arg1 and arg2 then local minVal = math.min(arg1, arg2) local maxVal = math.max(arg1, arg2) return math.random(minVal, maxVal) end end return p 8xujnm9pu2dk6h54rzt3fkalq60qtax 392396 392395 2026-08-29T05:39:01Z Ow! That Hurts! 8952 392396 Scribunto text/plain local p = {} -- Track if seeding has happened in this environment instance local seeded = false function p.main(frame) -- Seed the random number generator uniquely on the first call per page render if not seeded then -- os.time() combined with a high-resolution clock or fallback ensures unique seeds math.randomseed(os.time() + tonumber(tostring(os.clock()):reverse():gsub("%.", ""), 10)) seeded = true -- Warm up the generator (discard the first couple of predictable outputs) math.random() math.random() end local args = frame.args local arg1 = tonumber(args[1] or args.min) local arg2 = tonumber(args[2] or args.max) -- If no arguments are provided, return a float between 0 and 1 if not arg1 and not arg2 then return math.random() end -- If only one argument is provided, treat it as the upper bound (1 to n) if arg1 and not arg2 then if arg1 == 0 then return 0 elseif arg1 < 0 then return math.random(arg1, 0) else return math.random(1, arg1) end end -- If two arguments are provided, treat them as min and max bounds if arg1 and arg2 then local minVal = math.min(arg1, arg2) local maxVal = math.max(arg1, arg2) return math.random(minVal, maxVal) end end return p eqrg8k2hjq9h2afu0bi6fxi5li4zf0z Module:tenglar 828 118914 392414 2026-08-29T07:07:32Z Ow! That Hurts! 8952 skapað 392414 Scribunto text/plain local p = {} function p.main(frame) -- Get arguments from the parent template, fallback to frame if needed local args = frame:getParent().args if not args[1] then args = frame.args end local lang_code = args[1] if not lang_code then return '<span class="error">Vantar tungumálakóða (færibreyta 1)</span>' end -- Attempt to fetch the language name using standard Wiktionary language modules. -- Adjust "Module:languages" if the Icelandic Wiktionary uses a different name (e.g., "Module:tungumál"). local lang_name = lang_code -- Fallback to code if name isn't found local success, lang_module = pcall(require, "Module:languages") if success and lang_module then local lang_data = lang_module.getByCode(lang_code) if lang_data then -- Handle both OOP and flat-table module structures if type(lang_data.getCanonicalName) == "function" then lang_name = lang_data:getCanonicalName() elseif lang_data.name then lang_name = lang_data.name end end end -- Capitalize the first letter (equivalent to {{ucfirst:}}) -- We use mw.getContentLanguage() to handle Icelandic special characters properly (e.g., í -> Í) local lang_name_ucfirst = mw.getContentLanguage():ucfirst(lang_name) local links = {} -- Loop through all numbered arguments starting from 2 local i = 2 while args[i] do local term = mw.text.trim(args[i]) if term ~= "" then -- Create the format: [[word#Language_name|word]] local link = string.format("[[%s#%s|%s]]", term, lang_name_ucfirst, term) table.insert(links, link) end i = i + 1 end if #links == 0 then return '<span class="error">Vantar orð (færibreytur 2, 3, o.s.frv.)</span>' end -- Join the links together with a comma and a space return table.concat(links, ", ") end return p 9tjsphewnmq9wpk439wjiixnk3sa6pi 392417 392414 2026-08-29T07:21:17Z Ow! That Hurts! 8952 392417 Scribunto text/plain local p = {} function p.main(frame) -- Get arguments from the parent template, fallback to frame if needed local args = frame:getParent().args if not args[1] then args = frame.args end local lang_code = args[1] if not lang_code then return '<span class="error">Vantar tungumálakóða (færibreyta 1)</span>' end -- Attempt to fetch the language name using standard Wiktionary language modules. local lang_name = lang_code -- Fallback to code if name isn't found local success, lang_module = pcall(require, "Module:languages") if success and lang_module then local lang_data = lang_module.getByCode(lang_code) if lang_data then if type(lang_data.getCanonicalName) == "function" then lang_name = lang_data:getCanonicalName() elseif lang_data.name then lang_name = lang_data.name end end end -- Capitalize the first letter (equivalent to {{ucfirst:}}) local lang_name_ucfirst = mw.getContentLanguage():ucfirst(lang_name) local links = {} -- Loop through all numbered arguments starting from 2 local i = 2 while args[i] do local term = mw.text.trim(args[i]) if term ~= "" then -- Remove wikiformatting (2 or more single quotes for italics/bold) from the link target -- This leaves normal apostrophes (like in "don't" or "l'hôpital") completely intact. local target = string.gsub(term, "''+", "") -- Create the format: [[target#Language_name|display]] local link = string.format("[[%s#%s|%s]]", target, lang_name_ucfirst, term) table.insert(links, link) end i = i + 1 end if #links == 0 then return '<span class="error">Vantar orð (færibreytur 2, 3, o.s.frv.)</span>' end -- Join the links together with a comma and a space return table.concat(links, ", ") end return p ko04w8nowghdghc5dqvosxw68vl3r0s Snið:tengla 10 118915 392415 2026-08-29T07:11:09Z Ow! That Hurts! 8952 Bjó til síðu með „{{#invoke:tenglar|main}}<noinclude> ==Breytur== <code><nowiki>{{{1}}}</nowiki></code> — tungumálakóði <code><nowiki>{{{2}}}</nowiki></code>, <code><nowiki>{{{3}}}</nowiki></code>, <code><nowiki>{{{4}}}</nowiki></code>, o.fl. — orð ==Dæmi== # <code><nowiki>{{tengla|is|ábóti|orð|brygga}}</nowiki></code> #: {{tengla|is|ábóti|orð|brygga}} </noinclude>“ 392415 wikitext text/x-wiki {{#invoke:tenglar|main}}<noinclude> ==Breytur== <code><nowiki>{{{1}}}</nowiki></code> — tungumálakóði <code><nowiki>{{{2}}}</nowiki></code>, <code><nowiki>{{{3}}}</nowiki></code>, <code><nowiki>{{{4}}}</nowiki></code>, o.fl. — orð ==Dæmi== # <code><nowiki>{{tengla|is|ábóti|orð|brygga}}</nowiki></code> #: {{tengla|is|ábóti|orð|brygga}} </noinclude> p29gig4j7lcd0x5qp6inioc6vatoj4v Snið:t 10 118916 392416 2026-08-29T07:11:43Z Ow! That Hurts! 8952 skapað 392416 wikitext text/x-wiki #tilvísun [[Snið:tengla]] 6ggunhvy2i4ltczf5tdqtmzs8fvu4ve Snið:stenst á 10 118917 392418 2026-08-29T07:22:40Z Ow! That Hurts! 8952 Bjó til síðu með „• {{hástafir|stenst á}} {{tengla|{{{1}}}|''{{{2}}}''|{{#if:{{{3|}}}|''{{{3}}}''}}|{{#if:{{{4|}}}|''{{{4}}}''}}|{{#if:{{{5|}}}|''{{{5}}}''}}|{{#if:{{{6|}}}|''{{{6}}}''}}|{{#if:{{{7|}}}|''{{{7}}}''}}|{{#if:{{{8|}}}|''{{{8}}}''}}|{{#if:{{{9|}}}|''{{{9}}}''}}|{{#if:{{{10|}}}|''{{{10}}}''}}|{{#if:{{{11|}}}|''{{{11}}}''}}|{{#if:{{{12|}}}|''{{{12}}}''}}|{{#if:{{{13|}}}|''{{{13}}}''}}|{{#if:{{{14|}}}|''{{{14}}}''}}|{{#if:{{{15|}}}|''{{{15}}}''}}|{{#if:{{{16|}}}|''{{{1...“ 392418 wikitext text/x-wiki • {{hástafir|stenst á}} {{tengla|{{{1}}}|''{{{2}}}''|{{#if:{{{3|}}}|''{{{3}}}''}}|{{#if:{{{4|}}}|''{{{4}}}''}}|{{#if:{{{5|}}}|''{{{5}}}''}}|{{#if:{{{6|}}}|''{{{6}}}''}}|{{#if:{{{7|}}}|''{{{7}}}''}}|{{#if:{{{8|}}}|''{{{8}}}''}}|{{#if:{{{9|}}}|''{{{9}}}''}}|{{#if:{{{10|}}}|''{{{10}}}''}}|{{#if:{{{11|}}}|''{{{11}}}''}}|{{#if:{{{12|}}}|''{{{12}}}''}}|{{#if:{{{13|}}}|''{{{13}}}''}}|{{#if:{{{14|}}}|''{{{14}}}''}}|{{#if:{{{15|}}}|''{{{15}}}''}}|{{#if:{{{16|}}}|''{{{16}}}''}}|{{#if:{{{17|}}}|''{{{17}}}''}}|{{#if:{{{18|}}}|''{{{18}}}''}}|{{#if:{{{19|}}}|''{{{19}}}''}}|{{#if:{{{20|}}}|''{{{20}}}''}}|{{#if:{{{21|}}}|''{{{21}}}''}}}}<noinclude> ==Breytur== <code><nowiki>{{{1}}}</nowiki></code> — tungumálakóði <code><nowiki>{{{2}}}</nowiki></code>, <code><nowiki>{{{3}}}</nowiki></code>, <code><nowiki>{{{4}}}</nowiki></code>, o.fl. — orð ==Dæmi== # <code><nowiki>{{stenst á|is|halló|hæ}}</nowiki></code> #: {{stenst á|is|halló|hæ}} </noinclude> qpf9ir7lws8caxdvfux4mqagk0nk5sz