Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
834 views
in Q2A Core by
If I wanted to remove the no follow attribute in its entirety as we have set an if statement so only administrators have access to the WYSIWYG editor I thought I would simply be able to remove the "nofollow" attribute from qa_html_convert_urls(...) however this hasn't seemed to work, any thoughts?
related to an answer for: Can I remove "nofollow" for trusted links?

1 Answer

0 votes
by

When you say only admins have access to the WYSIWYG editor, do you mean all other users have the plain text editor? Because in that editor, URLs are still converted to links, e.g. http://www.google.com

But to prevent Q2A from adding nofollow in the first place, you need to remove (or comment out) the first 3 lines I posted in the comment:

    //$search = '/([^A-Za-z0-9])((http|https|ftp):\/\/\S+\.[^\s<>]+)/i';
    //$replace = '\1<a href="\2" rel="nofollow">\2</a>';
    //$html = trim( preg_replace($search, $replace, ' '.$html.' ') );

And don't add the other lines I posted there.

by
Thanks for your response, you can switch off the plain text editor converting links via the admin panel. Your code works for stripping the no follow attribute from URLs in the basic editor however I am looking to strip the nofollow attribute from links posted through the WYSIWYG editor, I have had a look through the forums at ckeditor, I just need to do a bit more delving into the plugin.
...