($el)
| 297 | } |
| 298 | |
| 299 | replaceEm($el) { |
| 300 | let that = this; |
| 301 | let hContent = $el.prop("outerHTML"); |
| 302 | let ems = $el.find('em'); |
| 303 | if (ems.length) { |
| 304 | ems.each(function (index, el) { |
| 305 | let outHtml = that.$(el).prop("outerHTML"); |
| 306 | let oText = that.$(el).text(); |
| 307 | let text = that.$(el).text(); |
| 308 | text = that.uReplaceStr(text); |
| 309 | text = text.replace(/\*/g, '\\*'); |
| 310 | let bText = `*${text}*`; |
| 311 | if (oText.match(/^\s/)) { |
| 312 | bText = ' ' + bText; |
| 313 | } |
| 314 | if (oText.match(/\s$/)) { |
| 315 | bText = bText + ' '; |
| 316 | } |
| 317 | hContent = hContent.replace(outHtml, ' ' + bText + ' '); |
| 318 | }); |
| 319 | } |
| 320 | return hContent; |
| 321 | } |
| 322 | |
| 323 | replaceSpec($el) { |
| 324 | let that = this; |
no test coverage detected