(attributes, opts)
| 2282 | Format attributes |
| 2283 | */ |
| 2284 | function formatAttrs(attributes, opts) { |
| 2285 | if (!attributes) return; |
| 2286 | |
| 2287 | var output = '', |
| 2288 | value; |
| 2289 | |
| 2290 | // Loop through the attributes |
| 2291 | for (var key in attributes) { |
| 2292 | value = attributes[key]; |
| 2293 | if (output) { |
| 2294 | output += ' '; |
| 2295 | } |
| 2296 | |
| 2297 | if (!value && booleanAttributes[key]) { |
| 2298 | output += key; |
| 2299 | } else { |
| 2300 | output += key + '="' + (opts.decodeEntities ? entities.encodeXML(value) : value) + '"'; |
| 2301 | } |
| 2302 | } |
| 2303 | |
| 2304 | return output; |
| 2305 | } |
| 2306 | |
| 2307 | /* |
| 2308 | Self-enclosing tags (stolen from node-htmlparser) |
no outgoing calls
no test coverage detected
searching dependent graphs…