Search code examples
redactor

Redactor: Adding target="_blank" to links


Redactor is a neat WYSIWYG JavaScript-based editor.

What is the proper way to add target="_blank" to all links created using the Redactor editor?


Solution

  • As of Redactor 1.2.5 it is now possible to simply set pasteLinkTarget in Redactor's settings when instantiating the editor:

    https://imperavi.com/redactor/docs/settings/paste/#setting-pasteLinkTarget

    This allows you to ensure that all links pasted or entered into the editor open in a new window.