Skip to content

ayc/wp-shortcodes.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wp-shortcodes.js Build Status

Render WP style shortcodes with your own custom rules

Inspired by shortcode.js

Usage

var text = "[first name=hello] [second]world![/second]";

var tags = {
	first: function(){
		return this.options.name;
	},
	second: function(){
		return this.contents;
	}
}

var out = new Shortcode(text, tags).get();
console.log(out); // hello world!

How to Test

Tests are run with mocha/chai

>npm test

About

Render WP style shortcodes with your own custom rules

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published