wtf-plugin-html

1.0.0 • Public • Published
a plugin for wtf_wikipedia

npm install wtf-plugin-html

Output all, or part of a wikipedia article in HTML.

This plugin can reliably convert links, bolds and italics to html - and it tries its best at more complex output like tables, lists, and templates.

const wtf = require('wtf_wikipedia')
wtf.extend(require('wtf-plugin-html'))

let doc = wtf('hello [[world]]')
doc.html()
// 'hello <a href="./world">world</a>'
<script src="https://unpkg.com/wtf_wikipedia"></script>
<script src="https://unpkg.com/wtf-plugin-html"></script>
<script defer>
  wtf.plugin(window.wtfHtml)
  wtf.fetch('Radiohead', function (err, doc) {
    console.log(doc.sentences()[0].html())
    // <b>Radiohead</b> are an English <a class="link" href="./Rock_music">rock</a> band ...
  })
</script>

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i wtf-plugin-html

Weekly Downloads

67

Version

1.0.0

License

MIT

Unpacked Size

35.7 kB

Total Files

17

Last publish

Collaborators

  • spencermountain