tinyMCE \r\n as new line breaker - tinymce

In my app i'm use tinyMCE editor to create rich email content, but now I need also sent messages as plain text now. Did someone knew how to force tinyMCE to use as a simple text editor w o any content editing, and use \r\n as line breaker?
I'm really stack at this moment, and thinking about writing own simple text editor, based on textarea. Didn't find in tinyMCE docs any solution.

TinyMCE is an HTML editor - there is no option to turn it into a plain text editor. The best you could do with TinyMCE is to transform the HTML into plain text when saving the form.

Related

Codemirror last line of textarea is unreadable and half cut off

I am using CodeMirror https://codemirror.net/ to turn a textarea into editable code.
CodeMirror handles the resizing of the textarea, and it mostly works. But the last line of the text in the text area is half-cutoff.
This problem does not happen when the codemirror CSS is allowed to operate alone, but when combining it with bootstrap css (et al), we get this problem.
Codemirror has lots of inscrutable options, and I am pretty sure one of them fixes this problem. Alternatively, it would be helpful to know which css style parameter or html parameter I should be fiddling with.
Where should I start solving this problem?

How to add a macro to an umbraco page when using the markdown editor

EDIT:
What I really need is an editor that'll allow me to write html directly and allow inserting macros.
I'm using WMD editor in umbraco 7 and need to add a partial view macro to the page.
The editor does not have an insert macro button and if I pasted the following code in the editor, it is not shown in the page. I think the markdown processor removes it from the page ; <umbraco:Macro Alias="YourMacroAlias" \>
How can I add the macro to the page ?
Out of the box, the WMD editor does not support embedding Macros in the same way as the Richtext Editor does. You could raise a feature request at http://issues.umbraco.org and see if they'll add it, or you could take the source of the WMD from the Umbraco source at https://github.com/umbraco/Umbraco-CMS and create your own version of the markdown editor based on it.
The way the Richtext editor does it is that it stores the macro details as a specially formatted bit of markup, and there's some code in the front end that looks for that markup and replaces it with the output of the Macro.
Go to the developer section. Open the Macros.
In your macro there is a checkbox "Use in rich text editor and the grid" and "Render in rich text editor and the grid" check this.
For Using in Rich Text the option must be checked in the Data Type.
In the Developer section there is below Data Types, the Richtext editor data type check umbmacro.
In the Rich Text editor there is a "Insert Macro" Button, the 2 gears icon.
But for a markdown datatype there is no button, no support, An option is invent a tag a replace you tag in the template with somethings else. To come a bit near a macro functionality.
Instead of using Markdown editor for less options, you can disable excess commands for the tinyMce too. Extra tags added by tinyMce can also be disabled, see at end
Firstly there is file in config folder named tinyMceConfig.config. It handles the options in all datatypes using tinyMce. Below is entry for macro
<command>
<umbracoAlias>umbracomacro</umbracoAlias>
<icon>images/editor/insMacro.gif</icon>
<tinyMceCommand value="" userInterface="true" frontendCommand="umbmacro">umbracomacro</tinyMceCommand>
<priority>62</priority>
</command>
Go to
Developer -> DataTypes -> Rich Text Editor
There will be toolbar checkbox list. Select umbmacro from the list and save the data type. You will see the macro on the WYSIWYG editor. Uncheck all unwanted options. Also you can create new datatype say "RTE Lite" using property editor "Rich Text Editor" and use this "RTE Lite" where less options are needed.
Edit: Okay, if you do not like extra p tag added by tinyMce, go to "tiny_mce_src.js" file from your umbraco solution, search for forced_root_block : 'p' and change it to forced_root_block : ''

TinyMCE editor inside a TinyMCE Plugin

I am creating a plugin for TinyMCE, which is basically a form that has a textarea in it. I want the user to be able to input formatted text in that textarea, using the TinyMCE editor. The problem is that I'm not able to 'enrich' the textarea element inside the dialog.htm file in any way. Does there exist a way to do such a thing?
Thanks in advance,
Tomor
I found a quick fix. I managed to put the editor in an iframe, following the suggestion in this post:
http://www.tinymce.com/forum/viewtopic.php?pid=84668#p84668
It seems a bit messy, but it works.

Strip formatting with TinyMCE

Simple question - after much Googling no real answer.
I want tinyMCE to stop auto-formatting text when it is pasted in. When text is copied and pasted in the text editor I want the text to be just text. None of the fluff which tinyMCE add's.
I don't need 'paste from word', I don't need anything else. I JUST WANT PLAIN TEXT PASTE EVERY TIME.
Surely there is an option to do this?
I think there is not an option to do this here and if then it is not reliable.
I use the paste_preprocessing parameter to get plain text. Everything is decribed here:
TinyMCE Paste As Plain Text

TinyMCE past image from MS Word

I need to copy word text with image to my server through copy - paste function. For that purpose, I choose TinyMCE editor.
The editor works fine, when inserting from word just text. It also works fine, when inserting from word just picture (the picture shows in TinyMCE textarea).
However, when I copy paste word text together with image, only the text shows in textarea.
Is there any way around how to solve this issue?
Next problem is, is there a plugin for TinyMCE that would get the link to the image from TinyMCE textarea, when pasting, and save the image on server?
You should have a look at the tinymce paste plugin - this should be able to handle it.