this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
this.delegate.finishTag();
this.transitionTo("beforeData" /* beforeData */);
this.delegate.reportSyntaxError('attribute name cannot start with equals sign');
this.transitionTo("attributeName" /* attributeName */);
this.delegate.beginAttribute();
this.delegate.appendToAttributeName(char);
this.transitionTo("attributeName" /* attributeName */);
this.delegate.beginAttribute();
attributeName: function () {
this.transitionTo("afterAttributeName" /* afterAttributeName */);
this.delegate.beginAttributeValue(false);
this.delegate.finishAttributeValue();
this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
this.transitionTo("beforeAttributeValue" /* beforeAttributeValue */);
this.delegate.beginAttributeValue(false);
this.delegate.finishAttributeValue();
this.delegate.finishTag();
this.transitionTo("beforeData" /* beforeData */);
else if (char === '"' || char === "'" || char === '<') {
this.delegate.reportSyntaxError(char + ' is not a valid character within attribute names');
this.delegate.appendToAttributeName(char);
this.delegate.appendToAttributeName(char);
afterAttributeName: function () {
this.delegate.beginAttributeValue(false);
this.delegate.finishAttributeValue();
this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
this.transitionTo("beforeAttributeValue" /* beforeAttributeValue */);
this.delegate.beginAttributeValue(false);
this.delegate.finishAttributeValue();
this.delegate.finishTag();
this.transitionTo("beforeData" /* beforeData */);
this.delegate.beginAttributeValue(false);
this.delegate.finishAttributeValue();
this.transitionTo("attributeName" /* attributeName */);
this.delegate.beginAttribute();
this.delegate.appendToAttributeName(char);
beforeAttributeValue: function () {
this.transitionTo("attributeValueDoubleQuoted" /* attributeValueDoubleQuoted */);
this.delegate.beginAttributeValue(true);
this.transitionTo("attributeValueSingleQuoted" /* attributeValueSingleQuoted */);
this.delegate.beginAttributeValue(true);
this.delegate.beginAttributeValue(false);
this.delegate.finishAttributeValue();
this.delegate.finishTag();
this.transitionTo("beforeData" /* beforeData */);
this.transitionTo("attributeValueUnquoted" /* attributeValueUnquoted */);
this.delegate.beginAttributeValue(false);
this.delegate.appendToAttributeValue(char);
attributeValueDoubleQuoted: function () {
var char = this.consume();
this.delegate.finishAttributeValue();
this.transitionTo("afterAttributeValueQuoted" /* afterAttributeValueQuoted */);
this.delegate.appendToAttributeValue(this.consumeCharRef() || '&');
this.delegate.appendToAttributeValue(char);
attributeValueSingleQuoted: function () {
var char = this.consume();
this.delegate.finishAttributeValue();
this.transitionTo("afterAttributeValueQuoted" /* afterAttributeValueQuoted */);
this.delegate.appendToAttributeValue(this.consumeCharRef() || '&');
this.delegate.appendToAttributeValue(char);
attributeValueUnquoted: function () {
this.delegate.finishAttributeValue();
this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
this.delegate.finishAttributeValue();
this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
this.delegate.appendToAttributeValue(this.consumeCharRef() || '&');
this.delegate.finishAttributeValue();
this.delegate.finishTag();
this.transitionTo("beforeData" /* beforeData */);
this.delegate.appendToAttributeValue(char);
afterAttributeValueQuoted: function () {
this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
this.transitionTo("selfClosingStartTag" /* selfClosingStartTag */);
this.delegate.finishTag();
this.transitionTo("beforeData" /* beforeData */);
this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
selfClosingStartTag: function () {
this.delegate.markTagAsSelfClosing();
this.delegate.finishTag();
this.transitionTo("beforeData" /* beforeData */);
this.transitionTo("beforeAttributeName" /* beforeAttributeName */);
endTagOpen: function () {
var char = this.consume();
if (char === '@' || char === ':' || isAlpha(char)) {
this.transitionTo("endTagName" /* endTagName */);
this.delegate.beginEndTag();
this.appendToTagName(char);
EventedTokenizer.prototype.reset = function () {
this.transitionTo("beforeData" /* beforeData */);
EventedTokenizer.prototype.transitionTo = function (state) {
EventedTokenizer.prototype.tokenize = function (input) {
this.tokenizePart(input);
EventedTokenizer.prototype.tokenizePart = function (input) {
this.input += preprocessInput(input);
while (this.index < this.input.length) {
var handler = this.states[this.state];
if (handler !== undefined) {
throw new Error("unhandled state " + this.state);
EventedTokenizer.prototype.tokenizeEOF = function () {
EventedTokenizer.prototype.flushData = function () {
if (this.state === 'data') {
this.delegate.finishData();
this.transitionTo("beforeData" /* beforeData */);
EventedTokenizer.prototype.peek = function () {
return this.input.charAt(this.index);
EventedTokenizer.prototype.consume = function () {
EventedTokenizer.prototype.consumeCharRef = function () {
var endIndex = this.input.indexOf(';', this.index);
var entity = this.input.slice(this.index, endIndex);
var chars = this.entityParser.parse(entity);
var count = entity.length;
// consume the entity chars
EventedTokenizer.prototype.markTagStart = function () {
EventedTokenizer.prototype.appendToTagName = function (char) {
this.tagNameBuffer += char;
this.delegate.appendToTagName(char);
EventedTokenizer.prototype.isIgnoredEndTag = function () {
var tag = this.tagNameBuffer;
return (tag === 'title' && this.input.substring(this.index, this.index + 8) !== '</title>') ||
(tag === 'style' && this.input.substring(this.index, this.index + 8) !== '</style>') ||
(tag === 'script' && this.input.substring(this.index, this.index + 9) !== '</script>');
var Tokenizer = /** @class */ (function () {
function Tokenizer(entityParser, options) {
if (options === void 0) { options = {}; }
this.tokenizer = new EventedTokenizer(this, entityParser, options.mode);
this._currentAttribute = undefined;
Tokenizer.prototype.tokenize = function (input) {
this.tokenizer.tokenize(input);
Tokenizer.prototype.tokenizePart = function (input) {
this.tokenizer.tokenizePart(input);
Tokenizer.prototype.tokenizeEOF = function () {
this.tokenizer.tokenizeEOF();
Tokenizer.prototype.reset = function () {
Tokenizer.prototype.current = function () {
throw new Error('token was unexpectedly null');
if (arguments.length === 0) {
for (var i = 0; i < arguments.length; i++) {
if (token.type === arguments[i]) {
throw new Error("token type was unexpectedly " + token.type);
Tokenizer.prototype.push = function (token) {
Tokenizer.prototype.currentAttribute = function () {
return this._currentAttribute;
Tokenizer.prototype.addLocInfo = function () {
line: this.tokenizer.line,
column: this.tokenizer.column
this.startLine = this.tokenizer.line;
this.startColumn = this.tokenizer.column;
Tokenizer.prototype.beginDoctype = function () {
type: "Doctype" /* Doctype */,
Tokenizer.prototype.appendToDoctypeName = function (char) {
this.current("Doctype" /* Doctype */).name += char;
Tokenizer.prototype.appendToDoctypePublicIdentifier = function (char) {
var doctype = this.current("Doctype" /* Doctype */);
if (doctype.publicIdentifier === undefined) {
doctype.publicIdentifier = char;
doctype.publicIdentifier += char;
Tokenizer.prototype.appendToDoctypeSystemIdentifier = function (char) {
var doctype = this.current("Doctype" /* Doctype */);
if (doctype.systemIdentifier === undefined) {
doctype.systemIdentifier = char;
doctype.systemIdentifier += char;
Tokenizer.prototype.endDoctype = function () {
Tokenizer.prototype.beginData = function () {
type: "Chars" /* Chars */,
Tokenizer.prototype.appendToData = function (char) {
this.current("Chars" /* Chars */).chars += char;
Tokenizer.prototype.finishData = function () {
Tokenizer.prototype.beginComment = function () {
type: "Comment" /* Comment */,
Tokenizer.prototype.appendToCommentData = function (char) {
this.current("Comment" /* Comment */).chars += char;
Tokenizer.prototype.finishComment = function () {
Tokenizer.prototype.tagOpen = function () { };
Tokenizer.prototype.beginStartTag = function () {
type: "StartTag" /* StartTag */,
Tokenizer.prototype.beginEndTag = function () {
type: "EndTag" /* EndTag */,
Tokenizer.prototype.finishTag = function () {
Tokenizer.prototype.markTagAsSelfClosing = function () {
this.current("StartTag" /* StartTag */).selfClosing = true;
Tokenizer.prototype.appendToTagName = function (char) {
this.current("StartTag" /* StartTag */, "EndTag" /* EndTag */).tagName += char;
Tokenizer.prototype.beginAttribute = function () {
this._currentAttribute = ['', '', false];
Tokenizer.prototype.appendToAttributeName = function (char) {
this.currentAttribute()[0] += char;
Tokenizer.prototype.beginAttributeValue = function (isQuoted) {
this.currentAttribute()[2] = isQuoted;
Tokenizer.prototype.appendToAttributeValue = function (char) {
this.currentAttribute()[1] += char;
Tokenizer.prototype.finishAttributeValue = function () {
this.current("StartTag" /* StartTag */).attributes.push(this._currentAttribute);
Tokenizer.prototype.reportSyntaxError = function (message) {
this.current().syntaxError = message;
function tokenize(input, options) {
var tokenizer = new Tokenizer(new EntityParser(namedCharRefs), options);
return tokenizer.tokenize(input);
// EXTERNAL MODULE: external ["wp","htmlEntities"]
var external_wp_htmlEntities_ = __webpack_require__("rmEH");
// CONCATENATED MODULE: ./node_modules/@wordpress/blocks/build-module/api/validation/logger.js
function createLogger() {
* Creates a log handler with block validation prefix.
* @param {Function} logger Original logger function.
* @return {Function} Augmented logger function.
function createLogHandler(logger) {
var log = function log(message) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
return logger.apply(void 0, ['Block validation: ' + message].concat(args));