| 216 | } |
| 217 | |
| 218 | replaceA($el) { |
| 219 | let that = this; |
| 220 | let hContent = $el.prop("outerHTML"); |
| 221 | let as = $el.find('a'); |
| 222 | if (as.length) { |
| 223 | as.each(function (index, el) { |
| 224 | let outHtml = that.$(el).prop("outerHTML"); |
| 225 | let href = that.$(el).attr('href'); |
| 226 | if (href.substring(0, 2) === '..') { |
| 227 | href = that.baseUrl + href.substring(2, href.length); |
| 228 | } |
| 229 | let text = that.$(el).text(); |
| 230 | hContent = hContent.replace(outHtml, `[${text}](${href})`); |
| 231 | }); |
| 232 | } |
| 233 | return hContent; |
| 234 | } |
| 235 | |
| 236 | replaceAForTable(content, $el) { |
| 237 | let that = this; |