🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

bbcode.js

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bbcode.js

Simple bbcode rendering library

0.4.0
latest
Source
npm
Version published
Weekly downloads
5
25%
Maintainers
1
Weekly downloads
 
Created
Source

Travis Build Status

bbcode.js

bbcode.js is a fairly simple library that will render bbcode to HTML.

Currently, it supports node and client-side JS (both global inclusion + require/AMD).

Installing

npm

npm install --save-dev bbcode.js

bower

bower install --save-dev bbcode

Usage

var bbcode = require('bbcode.js');

var result = bbcode.render("[url=\"http://www.example.com\"]Originally Posted by Author[/url]");

// Would render:
// <a class="bbcode_link" target="_blank" href="http://www.example.com">Originally Posted by Author</a>
var result = bbcode.render("[img width=25 height=15]url[/img]");

// Would render:
// <img class="bbcode_image" src="url" width="25" height="15"/>

Building

npm install
npm test

Compiled output will reside in the dist/ folder.

TODO

  • add more support for known and/or undocumented tags
  • go beyond bbcode and parse bbcode-like data (e.g. quotes)

License

bbcode.js is released under the MIT license.

Keywords

bbcode

FAQs

Package last updated on 31 Mar 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts