Package Exports
- tinymce.html
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tinymce.html) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
tinymce.html
TinyMCE includes sophisticated logic for cleaning up HTML content. What's interesting about this logic is that it's pure JavaScript. As it doesn't use any browser-specific APIs, it can be used with Node.js.
Example
var tinymce = require('tinymce.html');
var schema = new tinymce.html.Schema({
valid_elements: "@[class],#p,span,a[!href],strong/b",
valid_classes: "foo"
});
var serializer = new tinymce.html.Serializer({
indent: true,
indent_before: 'p',
indent_after: 'p'
}, schema);
var parser = new tinymce.html.DomParser({
forced_root_block: 'p'
}, schema);
var initialHtml = '<B title="title" class="foo bar">test</B><a href="//tinymce.com">' +
'TinyMCE</a><p>Lorem <a>Ipsum</a></p>';
var root = parser.parse(initialHtml);
var result = serializer.serialize(root);
console.log(result);
// <p><strong class="foo">test</strong><a href="//tinymce.com">TinyMCE</a></p>
// <p>Lorem Ipsum</p>
Options
- Schema:
verify_html
,schema
,extended_valid_elements
,invalid_elements
,valid_elements
,valid_classes
,valid_children
,custom_elements
- Parser:
forced_root_block
- Serializer:
indent
,indent_before
,indent_after