question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[string-strip-html] URLs are output even if tag is stripped

See original GitHub issue

Package’s name

string-strip-html

Describe the bug

const html = `
  Show in plaintext
  <not-plaintext>
    <p>No images? <a href="url">Click here</a>.</p>  
  </not-plaintext>
`

stripHtml(`a <pre><code>void a;</code></pre> b`, {
  stripTogetherWithTheirContents: ['not-plaintext'],
  dumpLinkHrefsNearby: {
    enabled: true
  }
})

Result:

Show in plaintext
url

Expected:

Show in plaintext

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
reveltcommented, Oct 13, 2022

btw first stage is complete, I patched all known string-strip-html issues/features/bugs, the 11.6.13 is out, now onto CJS

1reaction
cossssmincommented, Oct 13, 2022

But anyway, we digress - let’s take this separately, I’d be more than happy to work with you on improving Maizzle 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

string-strip-html - npm
Any URL links can be extracted and put after a previously linked element. Works when opening or closing tag bracket is missing on...
Read more >
string-strip-html open source npm package - Codsen
It's used when multiple strings are stripped from tags and then concatenated. ... false, Used to customise the output of link URL's: to...
Read more >
TypeError: stripHtml is not a function - Stack Overflow
I'm working a blog website using Next Js, when I try to make blog api for rich text-editor using string-strip-html then show me...
Read more >
string-strip-html - npm Package Health Analysis - Snyk
Strip HTML tags from strings. No parser, accepts mixed sources. For more information about how to use this package see README.
Read more >
string-strip-html | Yarn - Package Manager
If you're not ready yet, install an older version of this program, 8.3.0 ( npm i string-strip-html@8.3.0 ).
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found