GetmeUK / ContentTools

A JS library for building WYSIWYG editors for HTML content.
http://getcontenttools.com
MIT License
3.97k stars 399 forks source link

Edit plain text without html markup #118

Closed dmshvetsov closed 8 years ago

dmshvetsov commented 8 years ago

Is there a way to edit just block of text without html markup?

anthonyjb commented 8 years ago

Are you talking about within a text element (e.g a p tag), so the content could still be styled overall but there wouldn't be any option to apply markup to text within the element?

dmshvetsov commented 8 years ago

exactly

dmshvetsov commented 8 years ago

For example when I want to edit h1 tag. I just want to edit h1 text without allowing to editing markup.

anthonyjb commented 8 years ago

So no at the moment there isn't a way to do this through the framework, this question has been asked previously though here: https://github.com/GetmeUK/ContentTools/issues/79 and there is some advice on how to approach the problem for now.

dmshvetsov commented 8 years ago

Cool, then I'll close this issue.

dmshvetsov commented 8 years ago

Are you talking about within a text element (e.g a p tag), so the content could still be styled overall but there wouldn't be any option to apply markup to text within the element?

@anthonyjb I interpreted your question wrong. What exactly I want is to have a ContentEdit.Region that as a whole can acts as a form input text field or a textarea field. And of course solution for disabling ToolUI is also applicable to that type of Regions.

anthonyjb commented 8 years ago

OK so if we're talking about the region would that mean you still want paragraphs when people hit return? Would is the advantage over using a styled textarea?

dmshvetsov commented 8 years ago

Nope. No paragraphs after pressing return.

Would is the advantage over using a styled textarea?

Sorry. Not sure that I understand the question.

The reason why I think about this new behavior for Regions is because every region in our app is related with one DB column and I want to be able to edit title as a text string and body as html markup.