MCPcopy
hub / github.com/teadocs/numpy-cn / replaceSpan

Method replaceSpan

scripts/htmlToMd.js:252–269  ·  view source on GitHub ↗
($el)

Source from the content-addressed store, hash-verified

250 }
251
252 replaceSpan($el) {
253 let that = this;
254 let hContent = $el.prop("outerHTML");
255 let spans = $el.find('span');
256 if (spans.length) {
257 spans.each(function (index, el) {
258 let outHtml = that.$(el).prop("outerHTML");
259 let text = that.$(el).text();
260 let className = that.$(el).attr('class');
261 if (className === 'classifier' || className === 'versionmodified') {
262 hContent = hContent.replace(outHtml, `*${that.uReplaceStr(text)}* `);
263 } else {
264 hContent = hContent.replace(outHtml, `${text}`);
265 }
266 });
267 }
268 return hContent;
269 }
270
271 replaceStrong($el) {
272 let that = this;

Callers 1

getPcontentMethod · 0.95

Calls 1

uReplaceStrMethod · 0.80

Tested by

no test coverage detected