Skip to content

Commit

Permalink
fix for #497
Browse files Browse the repository at this point in the history
  • Loading branch information
spencermountain committed Aug 7, 2022
1 parent 1cddb43 commit d1d5216
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
20 changes: 10 additions & 10 deletions scratch.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,21 @@ wtf.plugin(plg)
// coach.text() //'Nick Nurse'

let str = `
{{Escute
| título = "Loverboy"
| arquivo = Loverboy.ogg
| descrição = {{pequeno|Uma amostra de "[[Loverboy (canção)|Loverboy]]", o primeiro ''single'' do seu oitavo álbum de estúdio e também trilha sonora do filme ''Glitter'' (2001), tornando-se assim no lançamento de estreia da artista com a distribuidora fonográfica Virgin Records.}}
| posição = esquerda
}}
foo ({{circa|4 BC}} AD 30 or 33 bar''
`
let doc = wtf(str)
console.log(doc.templates()[0].json()['descrição'])
// let doc = wtf(str)
// console.log(doc.images())




// wtf.fetch('Jesus').then((doc) => {

// console.log(doc.sentence(0).text())
// })
// str = ``
// let doc = wtf(str)
// console.log(doc.text())
let doc = wtf(str)
console.log(doc.sentence(0).text())
// console.log(doc.infobox().json())


Expand Down
5 changes: 5 additions & 0 deletions src/04-sentence/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ const isBalanced = function (str) {
if (quotes && quotes.length % 2 !== 0 && str.length < 900) {
return false
}
//make sure quotes are closed too
const parens = str.match(/[()]/g)
if (parens && parens.length % 2 !== 0 && str.length < 900) {
return false
}
return true
}

Expand Down

0 comments on commit d1d5216

Please sign in to comment.