(thisArg, _arguments, P, generator)
| 19954 | const { width, height } = options || {}; |
| 19955 | const attrs = Object.assign(Object.assign({}, width && { width }), height && { height }); |
| 19956 | const element = this.wrap("img", null, Object.assign({ src, alt }, attrs)); |
| 19957 | return this.addRaw(element).addEOL(); |
| 19958 | } |
| 19959 | /** |
| 19960 | * Adds an HTML section heading element |
| 19961 | * |
| 19962 | * @param {string} text heading text |
| 19963 | * @param {number | string} [level=1] (optional) the heading level, default: 1 |
| 19964 | * |
| 19965 | * @returns {Summary} summary instance |
| 19966 | */ |
| 19967 | addHeading(text, level) { |
| 19968 | const tag = `h${level}`; |
| 19969 | const allowedTag = ["h1", "h2", "h3", "h4", "h5", "h6"].includes(tag) ? tag : "h1"; |
| 19970 | const element = this.wrap(allowedTag, text); |
| 19971 | return this.addRaw(element).addEOL(); |
| 19972 | } |
| 19973 | /** |
| 19974 | * Adds an HTML thematic break (<hr>) to the summary buffer |
| 19975 | * |
| 19976 | * @returns {Summary} summary instance |
| 19977 | */ |
| 19978 | addSeparator() { |
| 19979 | const element = this.wrap("hr", null); |
| 19980 | return this.addRaw(element).addEOL(); |
| 19981 | } |
| 19982 | /** |
| 19983 | * Adds an HTML line break (<br>) to the summary buffer |
| 19984 | * |
| 19985 | * @returns {Summary} summary instance |
no test coverage detected