($, element)
| 224 | |
| 225 | clone.find("script, style, button, svg").remove(); |
| 226 | clone.find("br").replaceWith("\n"); |
| 227 | clone |
| 228 | .find("p, div, li, tr, td, th, span, strong, em, code") |
| 229 | .each(function addWordBoundaries() { |
| 230 | $(this).prepend(" "); |
| 231 | $(this).append(" "); |
| 232 | }); |
| 233 | |
| 234 | return clone |
| 235 | .text() |
| 236 | .replace(/\u00a0/g, " ") |
| 237 | .replace(/\s+/g, " ") |
| 238 | .trim(); |
| 239 | } |
no outgoing calls
no test coverage detected