How to use the html-tags.map 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 sindresorhus / is-html / index.js View on Github external
'use strict';
const htmlTags = require('html-tags');

const basic = /\s?|(]*>|]*>|]+>)+/i;
const full = new RegExp(htmlTags.map(tag => `<${tag}\\b[^>]*>`).join('|'), 'i');

module.exports = string => basic.test(string) || full.test(string);
github jxnblk / horror / examples / index.js View on Github external
{React.createElement(H, {
                is: type,
                css,
                children: voids.includes(type) ? undefined : 'Demo'
              })}
            
            
               {
                  this.update({ type: e.target.value })
                }}>
                {tags.map(t => (
                  <option label="{t}" value="{t}">
                ))}
              </option>
               {
                  this.update({ css: e.target.value })
                }}
              /&gt;
github jxnblk / bass-component / src / index.js View on Github external
if (typeof document !== 'undefined') {
  const sheet = document.head.appendChild(
    document.createElement('style')
  ).sheet
  insert = rule => {
    rules.push(rule)
    sheet.insertRule(rule, sheet.cssRules.length)
  }
}

const comp = type => props => React.createElement(tagHOC([])(type), css(props))

const Div = comp('div')

const Bass = tags
  .map(tag => comp(tag))
  .reduce((a, b, i) => Object.assign(a, { [tags[i]]: b }), Div)

Bass.css = () => rules.join('')
Bass.component = comp

export default Bass

html-tags

List of standard HTML tags

MIT
Latest version published 22 days ago

Package Health Score

77 / 100
Full package analysis