Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bbcode

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bbcode - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

15

lib/bbcode.js

@@ -31,2 +31,4 @@ // -----------------------------------------------------------------------

// [q]inline quote[/q]
// [quote=http://blogs.stonesteps.ca/showpost.asp?pid=33]inline quote[/quote]
// [quote]inline quote[/quote]
// [blockquote=http://blogs.stonesteps.ca/showpost.asp?pid=33]block quote[/blockquote]

@@ -55,3 +57,3 @@ // [blockquote]block quote[/blockquote]

// aceptable BBcode tags, optionally prefixed with a slash
var tagname_re = /^\/?(?:b|i|u|pre|samp|code|colou?r|size|noparse|url|link|s|q|blockquote|img|u?list|li)$/i;
var tagname_re = /^\/?(?:b|i|u|pre|center|samp|code|colou?r|size|noparse|url|link|s|q|(block)?quote|img|u?list|li)$/i;

@@ -136,2 +138,7 @@ // color names or hex color

case "center":
opentags.push(new taginfo_t(m2l, "</center>"));
crlf2br = false;
return "<center>";
case "color":

@@ -185,5 +192,7 @@ case "colour":

case "q":
case "quote":
case "blockquote":
opentags.push(new taginfo_t(m2l, "</" + m2l + ">"));
return m3 && m3.length && uri_re.test(m3) ? "<" + m2l + " cite=\"" + m3 + "\">" : "<" + m2l + ">";
var tag = (m2l === "q") ? "q" : "blockquote";
opentags.push(new taginfo_t(m2l, "</" + tag + ">"));
return m3 && m3.length && uri_re.test(m3) ? "<" + tag + " cite=\"" + m3 + "\">" : "<" + tag + ">";

@@ -190,0 +199,0 @@ case "list":

2

package.json

@@ -5,3 +5,3 @@ {

"main": "./lib/bbcode",
"version": "0.1.4",
"version": "0.1.5",
"author": "Nick Campbell (http://github.com/ncb000gt)",

@@ -8,0 +8,0 @@ "repository": {

@@ -37,2 +37,8 @@ var bbcode = require('../lib/bbcode');

it('should parse [center] to <center>', function() {
bbcode.parse('[center]Center[/center]', function(parse) {
parse.should.equal('<center>Center</center>');
});
});
it('should parse [color] to <span style="color:<color>"> for all colors', function() {

@@ -137,2 +143,8 @@ var colors = ['black', 'silver', 'gray', 'maroon', 'white', 'red', 'purple', 'fuchsia', 'green', 'lime', 'olive', 'yellow', 'navy', 'blue', 'teal', 'aqua', '#fff', '#ffffff', '#ff34ff'];

it('should parse [quote] as <blockquote>', function() {
bbcode.parse('[quote=person]quoted[/quote]', function(parse) {
parse.should.equal('<blockquote cite="person">quoted</blockquote>');
});
});
it('should try to fix broken markup', function() {

@@ -139,0 +151,0 @@ bbcode.parse('[b]test', function(parse) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc