Code Monkey home page Code Monkey logo

node-bbcode's Introduction

BBCode Parser for NodeJS

Build Status

This project aims to provide a robust BBCode Parser for NodeJS. Originally based on work by http://www.stonesteps.ca.

Usage

Install with NPM.

npm install bbcode

Write some code.

var bbcode = require('bbcode');
bbcode.parse('[b]text[/b]', function(content) { ... }

TODO

  • spoiler boxes
  • font face

License

BSD

node-bbcode's People

Contributors

bsparks avatar dpolivy avatar lotterfriends avatar ncb000gt avatar scotthovestadt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-bbcode's Issues

url parsed failed

i use npm install bbcode, and i make a source test file to test, the following url related tests failed!

    1) should parse [url="<url>"] to <a href=<url>>
     2) should parse [url='<url>'] to <a href=<url>>
     3) should parse [link=<url>]test[/link]
     4) should parse [link="<url>"]test[/link]
     5) should parse [link='<url>']test[/link]
     6) as attribute with quotes - [img="<img>"] to <img src=<img>>
     7) as attribute with single quotes - [img='<img>'] to <img src=<img>>




detail:

     1) bcrypt #parse should parse [url] and [link] should parse [url="<url>"] to <a href=<url>>:

         actual expected

         <a href[url="http://example.com">"]url</a<span style="color: red">[/url]</span>

if i git clone the source, the tests all past!

Publish 0.1.0

The package.json in the repo says version: 0.1.0

But the latest on npm is: 0.0.2

npm show bbcode version
npm info it worked if it ends with ok
npm info using [email protected]
npm info using [email protected]
0.0.2

npm info ok 

Can you publish the latest?

Nested tags do not work.

This module does not handle nested tags:

let code = 'wat [span][IMG]https://google.com[/IMG][/span]';
console.log(bbcode.parse(code, {}));
// wat <span>[IMG]https://google.com[/IMG]</span>

Why parse needs a callback

As far as I can see library is synchronous.
So why does parse needs a callback? Why not just return?

upd
Well, it's actually both: parse returns if no callback was specified. Anyway, it's better to hear author's opinion on that.
Do you aim to make in asynchronous in future? If so, I believe you should pass error as first argument to callback.

[marquee] tag works?

For some reason [marquee]whatever[/marquee] works even though it's no where found within your code (used npm install) any idea why?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.