How to use the html-tags.indexOf function in html-tags

To help you get started, we’ve selected a few html-tags 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 idyll-lang / idyll / packages / idyll-cli / src / resolvers / components.js View on Github external
return;
      }

      // Else try to import it as a node module.
      try {
        // npm modules are required via relative paths to support working with a locally linked idyll.
        resolved = slash(resolve.sync(name, { basedir: this.paths.INPUT_DIR }));
      } catch (err) {
        // Import errors are silently discarded.
        return;
      }
    });

    if (!resolved) {
      if (
        htmlTags.indexOf(name) > -1 ||
        svgTags.indexOf(name) > -1 ||
        name === 'root'
      ) {
        // It is a valid HTML component, but should not be added to the map.
        return;
      } else {
        if (['fullwidth', 'textcontainer'].indexOf(name) > -1) {
          throw new errors.OutOfDateError(name);
        }
        throw new errors.InvalidComponentError(name);
      }
    }

    debug(`Resolved component ${name} to ${resolved}`);
    return resolved;
  }
github idyll-lang / idyll / packages / idyll-document / src / visitors / node.js View on Github external
componentClass = componentClass[split[i]];
      }
      if (componentClass.hasOwnProperty('default')) {
        componentClass = componentClass.default;
      }
      if (isClass(componentClass)) {
        const update = component.handleUpdateProps(id);
        try {
          return class extends componentClass {
            updateProps(newProps) {
              return update.call(this, newProps);
            }
          }
        } catch(e) { /* just in case something weird happens, return the unmodified class */ }
      }
    } else if (htmlTags.indexOf(name.toLowerCase()) > -1) {
      componentClass = name.toLowerCase();
    }

    return componentClass;
  });
github idyll-lang / idyll / src / client / visitors / node.js View on Github external
if (componentClass.default) {
          return class extends componentClass.default {
            updateProps(newProps) {
              return update.call(this, newProps);
            }
          }
        }

        return class extends componentClass {
          updateProps(newProps) {
            return update.call(this, newProps);
          }
        }
      }
    } else if (htmlTags.indexOf(name.toLowerCase()) > -1) {
      componentClass = name.toLowerCase();
    }

    return componentClass;
  });
github idyll-lang / idyll / packages / idyll-document / lib / visitors / node.js View on Github external
_classCallCheck(this, _class2);

            return _possibleConstructorReturn(this, (_class2.__proto__ || Object.getPrototypeOf(_class2)).apply(this, arguments));
          }

          _createClass(_class2, [{
            key: 'updateProps',
            value: function updateProps(newProps) {
              return update.call(this, newProps);
            }
          }]);

          return _class2;
        }(componentClass);
      }
    } else if (htmlTags.indexOf(name.toLowerCase()) > -1) {
      componentClass = name.toLowerCase();
    }

    return componentClass;
  });
github stylelint / stylelint / lib / rules / selector-type-no-unknown / index.js View on Github external
return;
					}

					if (optionsMatches(options, 'ignoreNamespaces', tagNode.namespace)) {
						return;
					}

					if (optionsMatches(options, 'ignoreTypes', tagNode.value)) {
						return;
					}

					const tagName = tagNode.value;
					const tagNameLowerCase = tagName.toLowerCase();

					if (
						htmlTags.indexOf(tagNameLowerCase) !== -1 ||
						svgTags.indexOf(tagNameLowerCase) !== -1 ||
						keywordSets.nonStandardHtmlTags.has(tagNameLowerCase) ||
						mathMLTags.indexOf(tagNameLowerCase) !== -1
					) {
						return;
					}

					report({
						message: messages.rejected(tagName),
						node: rule,
						index: tagNode.sourceIndex,
						ruleName,
						result,
					});
				});
			});
github nickmessing / babel-plugin-jsx-v-model / index.js View on Github external
var isReservedTag = function isReservedTag(tag) {
  return ~htmlTags.indexOf(tag) || ~svgTags.indexOf(tag)
}
github stylelint / stylelint / src / rules / selector-type-no-unknown / index.js View on Github external
selectorTree.walkTags(tagNode => {
          if (!isStandardSyntaxTypeSelector(tagNode)) { return }

          if (optionsMatches(options, "ignoreTypes", tagNode.value)) { return }

          const tagName = tagNode.value
          const tagNameLowerCase = tagName.toLowerCase()

          if (htmlTags.indexOf(tagNameLowerCase) !== -1
            || svgTags.indexOf(tagNameLowerCase) !== -1
            || nonStandardHtmlTags.has(tagNameLowerCase)
          ) { return }

          report({
            message: messages.rejected(tagName),
            node: rule,
            index: tagNode.sourceIndex,
            ruleName,
            result,
          })
        })
      })
github stylelint / stylelint / lib / utils / isCustomElement.js View on Github external
if (selector.indexOf('-') === -1) {
		return false;
	}

	const selectorLowerCase = selector.toLowerCase();

	if (selectorLowerCase !== selector) {
		return false;
	}

	if (svgTags.indexOf(selectorLowerCase) !== -1) {
		return false;
	}

	if (htmlTags.indexOf(selectorLowerCase) !== -1) {
		return false;
	}

	if (keywordSets.nonStandardHtmlTags.has(selectorLowerCase)) {
		return false;
	}

	if (mathMLTags.indexOf(selectorLowerCase) !== -1) {
		return false;
	}

	return true;
};
github ben-eb / midas / src / toVDOM.js View on Github external
if (node.length) {
                        const reference2 = [];
                        loop(node, reference2);

                        push(node, [
                            name,
                            hspan(t.parenthesis, '('),
                            ...reference2,
                            hspan(t.parenthesis, ')'),
                        ]);
                    } else {
                        push(node, name);
                    }
                }
                if (type === t.tag) {
                    if (~htmlTags.indexOf(value)) {
                        push(node, [
                            node.ns,
                            hspan(t.tag, value),
                        ]);
                    } else {
                        push(node, [
                            node.ns,
                            value,
                        ]);
                    }
                }
                if (type === t.className) {
                    push(node, [
                        node.ns,
                        hspan(t.className, `.${value}`),
                    ]);

html-tags

List of standard HTML tags

MIT
Latest version published 22 days ago

Package Health Score

77 / 100
Full package analysis