=header= support as <h1>
See original GitHub issueI updated wtf_wikipedia@8.5.1 to wtf_wikipedia@9.0.0. Now I got following error when parsing to HTML with the additional modul wtf-plugin-html@0.2.1:
if (options.title === true && data.title) {
TypeError: Cannot read property ‘title’ of undefined at Document.toHtml [as html] (Y:_dev\wikiparser\node_modules\wtf-plugin-html\builds\wtf-plugin-html.js:34:40) at Object.<anonymous> (Y:_dev\wikiparser\app.js:46:20) at Module._compile (internal/modules/cjs/loader.js:1063:30) at Object.Module._extensions…js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) at internal/main/run_main_module.js:17:47
reproduce with this steps:
create test folder
npm init
npm i wtf_wikipedia
npm i wtf-plugin-html
create app.js
const wtf = require('wtf_wikipedia')
wtf.extend(require('wtf-plugin-html'))
var input = "'''some bold text'''"
console.log(wtf(input).html())
run
node app
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
hey, thanks Murat - I’m not sure what happened there. I reproduced this, and fixed it in
0.2.2
thanks for the heads-up. cheersI didn’t realize single-equal sign headers were possible. Looks like they are. I tried tweaking the regex to support these but started seeing failures on headings like this:
== Publikasies<ref>Esaach: http://www.esaach.org.za/index.php?title=Behr,_Mark</ref> ==
gonna punt one this for now. Can rework the section parser to be smarter, if this shows up for more cases. cheers