(options)
| 20144 | */ |
| 20145 | addImage(src, alt, options) { |
| 20146 | const { width, height } = options || {}; |
| 20147 | const attrs = Object.assign(Object.assign({}, width && { width }), height && { height }); |
| 20148 | const element = this.wrap("img", null, Object.assign({ src, alt }, attrs)); |
| 20149 | return this.addRaw(element).addEOL(); |
| 20150 | } |
| 20151 | /** |
| 20152 | * Adds an HTML section heading element |
| 20153 | * |
| 20154 | * @param {string} text heading text |
| 20155 | * @param {number | string} [level=1] (optional) the heading level, default: 1 |
| 20156 | * |
| 20157 | * @returns {Summary} summary instance |
| 20158 | */ |
| 20159 | addHeading(text, level) { |
| 20160 | const tag = `h${level}`; |
| 20161 | const allowedTag = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(tag) ? tag : "h1"; |
| 20162 | const element = this.wrap(allowedTag, text); |
no test coverage detected