本文整理汇总了TypeScript中tinymce/core/html/Writer.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: function
suite.test('Doctype', function () {
let writer;
writer = Writer();
writer.doctype(' text');
LegacyUnit.equal(writer.getContent(), '<!DOCTYPE text>');
writer = Writer();
writer.doctype('');
LegacyUnit.equal(writer.getContent(), '<!DOCTYPE>');
});
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:11,代码来源:WriterTest.ts
示例2: SaxParser
const normalizeHtml = function (html) {
const writer = Writer();
new SaxParser({
validate: false,
comment: writer.comment,
cdata: writer.cdata,
text: writer.text,
end: writer.end,
pi: writer.pi,
doctype: writer.doctype,
start (name, attrs, empty) {
attrs.sort(function (a, b) {
if (a.name === b.name) {
return 0;
}
return a.name > b.name ? 1 : -1;
});
writer.start(name, attrs, empty);
}
}).parse(html);
return writer.getContent();
};
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:27,代码来源:HtmlUtils.ts
示例3: SaxParser
const sanitize = function (editor, html) {
if (Settings.shouldFilterHtml(editor) === false) {
return html;
}
const writer = Writer();
let blocked;
new SaxParser({
validate: false,
allow_conditional_comments: false,
special: 'script,noscript',
comment (text) {
writer.comment(text);
},
cdata (text) {
writer.cdata(text);
},
text (text, raw) {
writer.text(text, raw);
},
start (name, attrs, empty) {
blocked = true;
if (name === 'script' || name === 'noscript') {
return;
}
for (let i = 0; i < attrs.length; i++) {
if (attrs[i].name.indexOf('on') === 0) {
return;
}
if (attrs[i].name === 'style') {
attrs[i].value = editor.dom.serializeStyle(editor.dom.parseStyle(attrs[i].value), name);
}
}
writer.start(name, attrs, empty);
blocked = false;
},
end (name) {
if (blocked) {
return;
}
writer.end(name);
}
}, Schema({})).parse(html);
return writer.getContent();
};
开发者ID:aha-app,项目名称:tinymce-word-paste-filter,代码行数:57,代码来源:Sanitize.ts
注:本文中的tinymce/core/html/Writer.default函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论