Unsupported template fix

node v18.11.0
version: master
endpointsharetweet
const wtf=require('wtf_wikipedia') wtf.extend((models, templates) => { templates.unknown1 = 'handled'; }) let str = ` {{Infobox officeholder | name = Dr. Rajesh Sonkar | office1 = {{unknown1}} | office2 = {{unknown2}} | office3 = {{unknown3}} }}` let doc = wtf(str, { templateFallbackFn: (tmpl, list, parse) => { let obj = parse(tmpl) list.push(obj) return '[unsupported template]' } }) doc.infobox().json()
Loading…

no comments

    sign in to comment