User:Theleekycauldron/Scripts/PSHAW/dependencies/Hook.js: Difference between revisions
Content deleted Content added
i hate async so much |
def capitalize |
||
(2 intermediate revisions by the same user not shown) | |||
Line 12:
copies or substantial portions of the Software.
*/
function capitalize(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
class Hook {
constructor(id,content,credits){
Line 18 ⟶ 20:
this.content = content;
this.articles = []
for (let m of this.content.matchAll(/'''[^']*?\[\[([^\]\|]+)[^\]]*\]\][^']*?'''|\[\[.*'''([^']+)'''\]\]/g)){
this.articles.push(capitalize(m[1]))
}
this.credits = credits
Line 94 ⟶ 96:
})
}
}
// </nowiki>
|