Package Exports
- bbcode-html
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bbcode-html) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
bbcode-html
bbcode-html
NPM 下载包
npm i bbcode-html --save-dev
bbcode使用
import BBCODE from 'bbcode-html'
BBCODE.render("[url=\"http://www.baidu.com\"]百度[/url]")
// <a href="www.baidu.com" class="ask_link" target="_blank">百度</a>
var converter = new BBCODE.HTML2BBCode(Options);
var bbcode = converter.feed(data);
console.log(bbcode.toString());Options配置
new BBCODE.HTML2BBCode({
// enable image scale, default: false
imagescale: true,
// enable transform pixel size to size 1-7, default: false
transsize: true,
// disable list <ul> <ol> <li> support, default: false
nolist: true,
// disable text-align center support, default: false
noalign: true,
// disable HTML headings support, transform to size, default: false
noheadings: true
});For detailed explanation on how things work, checkout the docs for bbcode-html.