I
I
Ivanq2016-01-24 20:07:51
JavaScript
Ivanq, 2016-01-24 20:07:51

ContentEditable - exit element?

Hey!
Wrote my simplest WYSIWYG editor for HTML. The editor works on execCommand:

document.execCommand("bold");
document.execCommand("italic");
document.execCommand("createLink", false, prompt("Введите адрес ссылки:", "http://"));
document.execCommand("formatBlock", false, "blockquote");

But! If I do the last line (blockquote), the text wraps in a blockquote and it's impossible to get out of it. Is there any way to make it possible to "leave" an element?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dima, 2016-01-24
@CrazyFail

Pre-create a new line, I think (then you can just trim the spaces, trim)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question