Skip to content

Commit

Permalink
keep legend wiki text #497
Browse files Browse the repository at this point in the history
  • Loading branch information
spencermountain committed Nov 29, 2022
1 parent 34606fd commit 30c1750
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
19 changes: 13 additions & 6 deletions scratch.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@ wtf.plugin(plg)
// let doc = wtf(str)
// console.log(doc.sentences()[0].text())

let str = `
{{Картка:Лідер
| оригінал імені = foo
| жінка = bar
}}`
let str = `[[File:Jewish people around the world.svg|thumb|Map of the Jewish diaspora.<br />
more img|240x240px]]
foobar
`

// const file_reg = new RegExp('file:(.+?)[|\\]]', 'iu')
// console.log(str.match(file_reg))
let doc = wtf(str)
console.log(doc.infoboxes().map(t => t.json()))
console.log(doc.sentence(0).text())
// console.log(doc.infoboxes().map(t => t.json()))

// wtf.fetch('Jewish diaspora').then((doc) => {
// console.log(doc.sentence(0).text())
// })
3 changes: 2 additions & 1 deletion src/template/custom/text-and-data/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ let templates = {
let order = ['color', 'label']
let obj = parse(tmpl, order)
list.push(obj)
return obj.label || ' '
// return obj.label || ' '
return tmpl // keep the wiki?
},

isbn: (tmpl, list) => {
Expand Down

0 comments on commit 30c1750

Please sign in to comment.