(node, config)
| 268 | * @returns {string} |
| 269 | */ |
| 270 | const stringifyAttributes = (node, config) => { |
| 271 | let attrs = ''; |
| 272 | for (const [name, value] of Object.entries(node.attributes)) { |
| 273 | attrs += ' ' + name; |
| 274 | |
| 275 | if (value !== undefined) { |
| 276 | const encodedValue = value |
| 277 | .toString() |
| 278 | .replace(config.regValEntities, config.encodeEntity); |
| 279 | attrs += config.attrStart + encodedValue + config.attrEnd; |
| 280 | } |
| 281 | } |
| 282 | return attrs; |
| 283 | }; |
| 284 | |
| 285 | /** |
| 286 | * @param {import('./types.js').XastText} node |
no test coverage detected