cjwirth / RichEditorView

RichEditorView is a simple, modular, drop-in UIView subclass for Rich Text Editing.
BSD 3-Clause "New" or "Revised" License
1.9k stars 445 forks source link

bold and underline doesn't work well #140

Open zhixingxi opened 7 years ago

zhixingxi commented 7 years ago

when I switch bold or underline in the "简体中文-拼音" of keyboard type, I always can't cancel bold or underline;

bakonMa commented 7 years ago

+1

bigggge commented 6 years ago

rich_editor.js

RE.setBold = function() {
    if (document.queryCommandState('bold') && !RE.rangeSelectionExists()) {
        document.execCommand('bold', false, null);
        document.execCommand('insertHTML', false, '‌');
    } else {
        document.execCommand('bold', false, null);
    }
};