Artifact Content
Artifact c02db925c056e00016052a7f2bd6c87628e667a747decdf12e515da0d098193f:
- File public/riot-3.13.2/lib/browser/common/util/dom/walk-attributes.js — part of check-in [12a9bb700d] at 2021-08-11 18:56:04 on branch trunk — Import from git Added a changelog (user: dev size: 439)
import { RE_HTML_ATTRS } from './../../global-variables' /** * Minimize risk: only zero or one _space_ between attr & value * @param { String } html - html string we want to parse * @param { Function } fn - callback function to apply on any attribute found */ export default function walkAttributes(html, fn) { if (!html) return let m while (m = RE_HTML_ATTRS.exec(html)) fn(m[1].toLowerCase(), m[2] || m[3] || m[4]) }