How to use the mobiledoc-kit/utils/dom-utils.isCommentNode function in mobiledoc-kit

To help you get started, we’ve selected a few mobiledoc-kit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gazooka / GhostInAzureWebApp / node_modules / @tryghost / mobiledoc-kit / src / js / parsers / section.js View on Github external
_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:
github gazooka / GhostInAzureWebApp / node_modules / @tryghost / mobiledoc-kit / src / js / parsers / section.js View on Github external
_updateStateFromElement(element) {
    if (isCommentNode(element)) {
      return;
    }

    let { state } = this;
    state.section = this._createSectionFromElement(element);
    state.markups = this._markupsFromElement(element);
    state.text = '';
  }
github bustle / mobiledoc-kit / src / js / parsers / section.js View on Github external
_isSkippable(element) {
    return isCommentNode(element) ||
           (element.nodeType === NODE_TYPES.ELEMENT &&
            contains(SKIPPABLE_ELEMENT_TAG_NAMES,
                    normalizeTagName(element.tagName)));
  }
}