You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
14 KiB
2 lines
14 KiB
5 years ago
|
/*! Project:无, Create:FWS 2020.01.08 21:48, Update:FWS 2020.01.08 21:48 */
|
||
|
"use strict";function whitespace(t){return" "===t||"\n"===t||"\t"===t||"\f"===t||"\r"===t}function ifElseState(t,e,s){var i=t.toLowerCase();return t===i?function(t,a){a===i?t._state=e:(t._state=s,t._index--)}:function(a,_){_===i||_===t?a._state=e:(a._state=s,a._index--)}}function consumeSpecialNameChar(t,e){var s=t.toLowerCase();return function(i,a){a===s||a===t?i._state=e:(i._state=3,i._index--)}}var __importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});var decode_codepoint_1=__importDefault(require("./entities/decode_codepoint")),entities_json_1=__importDefault(require("./entities/maps/entities")),legacy_json_1=__importDefault(require("./entities/maps/legacy")),xml_json_1=__importDefault(require("./entities/maps/xml")),stateBeforeCdata1=ifElseState("C",23,16),stateBeforeCdata2=ifElseState("D",24,16),stateBeforeCdata3=ifElseState("A",25,16),stateBeforeCdata4=ifElseState("T",26,16),stateBeforeCdata5=ifElseState("A",27,16),stateBeforeScript1=consumeSpecialNameChar("R",34),stateBeforeScript2=consumeSpecialNameChar("I",35),stateBeforeScript3=consumeSpecialNameChar("P",36),stateBeforeScript4=consumeSpecialNameChar("T",37),stateAfterScript1=ifElseState("R",39,1),stateAfterScript2=ifElseState("I",40,1),stateAfterScript3=ifElseState("P",41,1),stateAfterScript4=ifElseState("T",42,1),stateBeforeStyle1=consumeSpecialNameChar("Y",44),stateBeforeStyle2=consumeSpecialNameChar("L",45),stateBeforeStyle3=consumeSpecialNameChar("E",46),stateAfterStyle1=ifElseState("Y",48,1),stateAfterStyle2=ifElseState("L",49,1),stateAfterStyle3=ifElseState("E",50,1),stateBeforeEntity=ifElseState("#",52,53),stateBeforeNumericEntity=ifElseState("X",55,54),Tokenizer=function(){function t(t,e){this._state=1,this._buffer="",this._sectionStart=0,this._index=0,this._bufferOffset=0,this._baseState=1,this._special=1,this._running=!0,this._ended=!1,this._cbs=e,this._xmlMode=!(!t||!t.xmlMode),this._decodeEntities=!(!t||!t.decodeEntities)}return t.prototype.reset=function(){this._state=1,this._buffer="",this._sectionStart=0,this._index=0,this._bufferOffset=0,this._baseState=1,this._special=1,this._running=!0,this._ended=!1},t.prototype._stateText=function(t){"<"===t?(this._index>this._sectionStart&&this._cbs.ontext(this._getSection()),this._state=2,this._sectionStart=this._index):this._decodeEntities&&1===this._special&&"&"===t&&(this._index>this._sectionStart&&this._cbs.ontext(this._getSection()),this._baseState=1,this._state=51,this._sectionStart=this._index)},t.prototype._stateBeforeTagName=function(t){"/"===t?this._state=5:"<"===t?(this._cbs.ontext(this._getSection()),this._sectionStart=this._index):">"===t||1!==this._special||whitespace(t)?this._state=1:"!"===t?(this._state=15,this._sectionStart=this._index+1):"?"===t?(this._state=17,this._sectionStart=this._index+1):(this._state=this._xmlMode||"s"!==t&&"S"!==t?3:31,this._sectionStart=this._index)},t.prototype._stateInTagName=function(t){("/"===t||">"===t||whitespace(t))&&(this._emitToken("onopentagname"),this._state=8,this._index--)},t.prototype._stateBeforeCloseingTagName=function(t){whitespace(t)||(">"===t?this._state=1:1!==this._special?"s"===t||"S"===t?this._state=32:(this._state=1,this._index--):(this._state=6,this._sectionStart=this._index))},t.prototype._stateInCloseingTagName=function(t){(">"===t||whitespace(t))&&(this._emitToken("onclosetag"),this._state=7,this._index--)},t.prototype._stateAfterCloseingTagName=function(t){">"===t&&(this._state=1,this._sectionStart=this._index+1)},t.prototype._stateBeforeAttributeName=function(t){">"===t?(this._cbs.onopentagend(),this._state=1,this._sectionStart=this._index+1):"/"===t?this._state=4:whitespace(t)||(this._state=9,this._sectionStart=this._index)},t.prototype._stateInSelfClosingTag=function(t){">"===t?(this._cbs.onselfclosingtag(),this._state=1,this._sectionStart=this._index+1):whitespace(t)||(this._state=8,this._index--)},t.prototype._stateInAttributeName=function(t){("="===t||"/"===t||">"===t||whitespace(t))&&(this._cbs.onattribname(this._getSection()),this._
|