WPML — Markup Language for Web Publications
Language designed especially for editing web publications (articles, messages, comments).
Web-site owner can limit allowed tags, classes, ids and HTML-attributes.
WPML-document can contain meta information (title, lang, tags, etc) that is not converted to HTML but available as a javascript dictionary.
Support plugins that allow to embed rich formating in safe mode.
Example of WPML:
!title: Hello world!
!lang: en
!tags: hello, world
p.lead: Hello world!
Lorem Ipsum paragraph #1
Lorem Ipsum paragraph #2
pic: userpic.jpg
.caption: Userpic
youtube: https://youtu.be/-Wdwj4JfkrA
It can be converted to HTML on server-side or client-side.
Configurations looks like:
var _wpml = var escape = var htmlTag = var assign = var apply = { return } var plugins = { var attrs = return } var opts = javascript: false plugins: plugins linkPlugin: 'oembed' whitelist: 'iframe p div h3 h4 a code pre br hr img ul ol li dl dt dd small em b i strong span sub sup cite abbr section aside' idTest: /^wp[\w]+/ classTest: /^/ exportswpml = { return _wpml }
Example of usage:
var doc = wpmlconsole
The library works well in browserify environment. To build a standalone version at dist/wpml.js you can use:
$ npm run build