m-svg-parser

1.0.5 • Public • Published

svg parser

parse svg to vdom

import parser from 'svg-parser'

const setAttrsForText = (el) => {
  const tagName = el.tagName || ''
  if (tagName.toLowerCase() === 'text') {
    el.setAttribute('id', 'text')
  }
}
const rules = [setAttrsForText]
const vSvg = parser(svg, rules)

Readme

Keywords

Package Sidebar

Install

npm i m-svg-parser

Weekly Downloads

1

Version

1.0.5

License

MIT

Unpacked Size

32.2 kB

Total Files

11

Last publish

Collaborators

  • micleming