JSFiddle - React, Tailwind, and code Playground

HTML

<p>Press ,, </p>
<textarea></textarea>

JavaScript

$("textarea").bind("keyup", function() {
    var $input = $(this),
        text = $input.val();
    var pos = text.slice(0, this.selectionStart).length - 1;
    if (text.indexOf(",,") > 0) {    
        $input.val(text.replace(/,,/g, "′"));
        this.setSelectionRange(pos, pos);
    }
});