首页
话题
消息
手册
我的
返回介绍

tinymce-html-SaxParser

发布于 2019-05-06 字数2469 浏览 848 评论 0

Examples

var parser = new tinymce.html.SaxParser({
    validate: true,

    comment: function(text) {
        console.log('Comment:', text);
    },

    cdata: function(text) {
        console.log('CDATA:', text);
    },

    text: function(text, raw) {
        console.log('Text:', text, 'Raw:', raw);
    },

    start: function(name, attrs, empty) {
        console.log('Start:', name, attrs, empty);
    },

    end: function(name) {
        console.log('End:', name);
    },

    pi: function(name, text) {
        console.log('PI:', name, text);
    },

    doctype: function(text) {
        console.log('DocType:', text);
    }
}, schema);

Constructors

name summary defined by
SaxParser() Constructs a new SaxParser instance. tinymce.html.SaxParser

Methods

name summary defined by
parse() Parses the specified HTML string and executes the callbacks for each item it finds. tinymce.html.SaxParser

Constructors

SaxParser

public constructor function SaxParser(settings:Object, schema:tinymce.html.Schema)

Constructs a new SaxParser instance.

Parameters
  • settings (Object) – Name/value collection of settings. comment, cdata, text, start and end are callbacks.
  • schema (tinymce.html.Schema) – HTML Schema class to use when parsing.

Methods

parse

parse(html:String)

Parses the specified HTML string and executes the callbacks for each item it finds.

Examples
SaxParser({...}).parse('<b>text</b>');
Parameters
  • html (String) – Html string to sax parse.

Can’t find what you’re looking for? Let us know.

Except as otherwise noted, the content of this page is licensed under the Creative Commons BY-NC-SA 3.0 License, and code samples are licensed under the Apache 2.0 License.

您暂时不能评论!

管理员开启了需要登录才能够评论,你可以免费注册一个本站的账号。

还没有评论!

目前还没有任何评论,快来抢沙发吧!