Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore tags option #125

Merged
merged 7 commits into from
Apr 18, 2016
Merged

Ignore tags option #125

merged 7 commits into from
Apr 18, 2016

Conversation

nfrasser
Copy link
Owner

@nfrasser nfrasser commented Apr 17, 2016

Providing this option as an array of tag names will prevent linkify from running inside certain tags like script and style. No tags are specified by default.

Example usage

const linkifyHtml = require('./linkify/html');
const result = linkifyHtml(
  'Please ignore <script>var a = {}; a.com = "Hi";</script> \n' + 
  'but not <span>b.ca</span>', {
  ignoreTags: ['script', 'style']
});

console.log(result); 
// 'Please ignore <script>var a = {}; a.com = "Hi";</script> 
// but not <span><a href="http://b.ca">b.ca</a></span>'

Progress

Issues

@nfrasser nfrasser self-assigned this Apr 17, 2016
@nfrasser nfrasser added this to the 2.0 milestone Apr 17, 2016
@nfrasser nfrasser merged commit 3ae6099 into master Apr 18, 2016
@nfrasser nfrasser deleted the ignore-tags branch April 18, 2016 00:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant