Comments (4)
Hey choxnox, how are you looking to specify this? Would a rel
option that applies the "rel" attribute to all generated anchor tags work? Or are you looking for more control that you can specify it on a per-anchor basis?
from autolinker.js.
I'd like this too.
For now, I pipe the output through jQuery to do it reliably, but obviously it's a little heavy because it has to create a dom and such.
var retHtml = Autolinker.link(html, {newWindow: false, stripPrefix: false, truncate: 100, twitter: false, className: 'autolinked'});
var retSel = $($.parseHTML('<div class="autolink-outer-wrapper"><div class="autolink-inner-wrapper">'+retHtml+'</div><div>'));
retSel.find('a.autolinked').attr('rel', 'nofollow');
var newHtml = retSel.find('.autolink-inner-wrapper').first().html();
from autolinker.js.
Have a fix here: 02f2e81
from autolinker.js.
Finally possible using replaceFn
! Example:
var html = Autolinker.link( text, {
replaceFn : function( autolinker, match ) {
var tag = autolinker.getTagBuilder().build( match ); // Returns an Autolinker.HtmlTag instance
tag.setAttr( 'rel', 'nofollow' );
return tag;
}
} );
from autolinker.js.
Related Issues (20)
- 3 seconds to parse link in safari HOT 7
- Request: Add taiwanese style phone number format
- URL with multiple email addresses in query string is not linked correctly
- Autolinker vulnerable to RTLO URL spoofing attacks HOT 26
- Bug: getUrl method not working correctly for links in markdown formats HOT 1
- doc/release v3.16.0 changelog missing HOT 1
- urls.wwwMatches usecase HOT 4
- Links with `¬` in query string are broken
- encoded email address is split
- Wrong result when parsing CJK(中文/日文/韩文) char followed by colon HOT 1
- Failed to parse source map HOT 2
- Add support for YouTube hashtags HOT 1
- Add support for YouTube mentions HOT 1
- Url with protocol prefixed with emoji being incorrectly parsed HOT 1
- Help to create Markdown Link Matcher
- Enable `inlineSources`
- URL as value in key-value pair parsed only partially (and incorrectly)
- [Tiktok mentions] - parsing does not match tiktok mention behaviour HOT 2
- Detection If a Persian word is attached before the link
- Help fix
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from autolinker.js.