Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_createSectionFromElement(element) {
if (isCommentNode(element)) {
return;
}
let { builder } = this;
let section;
let {tagName, sectionType, inferredTagName} =
this._getSectionDetails(element);
switch (sectionType) {
case LIST_SECTION_TYPE:
section = builder.createListSection(tagName);
break;
case LIST_ITEM_TYPE:
section = builder.createListItem();
break;
case MARKUP_SECTION_TYPE:
_updateStateFromElement(element) {
if (isCommentNode(element)) {
return;
}
let { state } = this;
state.section = this._createSectionFromElement(element);
state.markups = this._markupsFromElement(element);
state.text = '';
}
_isSkippable(element) {
return isCommentNode(element) ||
(element.nodeType === NODE_TYPES.ELEMENT &&
contains(SKIPPABLE_ELEMENT_TAG_NAMES,
normalizeTagName(element.tagName)));
}
}