replacing every newline with \n for storage is more difficult than one replace operation). I tried to roll my own, but I found that contentEditable has a nasty habit of producing different tags in different browsers (for example, some insert more br tags than others, some split the paragraphs into p tags differently.), and since storing raw HTML is out of the question for security reasons, I've found it insanely difficult to write a parser that can account for all of these differences and store the output correctly in a standard format (ie. bold, italics, underline, differing font sizes and colors, etc. Load the textEditor.js JavaScript library and Font Awesome iconic font within the doc. For simplicity, I want to use a JS-based editor with the typical formatting features, ie. Now, let’s create a rich text editor as a custom component with some format buttons. Then call a single line of code when the user press on any of them. So our mission is to create a toolbar with buttons. I'm trying to develop a web application that will allow users to store a small "about me" section on themselves. With this function, to make selected text bold, we need to call document.execCommand ('bold', false) function, and that’s it.
0 Comments
Leave a Reply. |