This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import { RichUtils, Modifier, EditorState, SelectionState } from 'draft-js'; | |
function isURL(text) { | |
return text.startsWith('http://'); // insert your favorite library here | |
} | |
/* | |
Function you can call from your toolbar or "link button" to manually linkify | |
the selected text with an "explicit" flag that prevents autolinking from | |
changing the URL if the user changes the link text. |