MCPcopy Create free account
hub / github.com/THU-MAIC/OpenMAIC / attrString

Function attrString

packages/mathml2omml/src/parse-stringify/stringify.js:1–10  ·  view source on GitHub ↗
(attribs)

Source from the content-addressed store, hash-verified

1function attrString(attribs) {
2 const buff = []
3 for (const key in attribs) {
4 buff.push(`${key}="${attribs[key]}"`)
5 }
6 if (!buff.length) {
7 return ''
8 }
9 return ` ${buff.join(' ')}`
10}
11
12function escapeXmlText(str) {
13 return str.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;')

Callers 1

stringifyFunction · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected