TinyMCE strips own codesample - tinymce

I'm using TinyMCE's codesample plugin. It works the first time and saves correctly into the database, but when opening the editor again, it either strips the code sample content (if it's "illegal") or places it outside of the codesample tags.
Saved Code:
<pre class="language-markup"><code><!DOCTYPE html></code></pre>
When loading the editor again:
<pre class="language-markup"><code></code></pre>
Should the content somehow be filtered before returning it to the editor? I assume it's because the editor is converting the escaped HTML back to normal tags first...seems a bit silly really.
Anyone know a workaround for this or encountered this before?
Thanks in advance

See this TinyMCE Fiddle:
http://fiddle.tinymce.com/ITfaab
It seems to load your example code back into the editor just fine. What are you doing differently?

Related

How to change tinyMCE editor value to return html element only

I have a problem with the TinyMCE editor that I'd like to fix.
The tinymce editor converts to [b]content[/b] for bold text instead of <strong>content</strong> or <b>content</b>
All inline elements also do the same. including; img, italic, URL, etc.
I have checked the doc and search google, but, I'm not getting any useful answers. I'd appreciate it if anyone can be able to help. Thanks
You are likely running the bbcode plugin with TinyMCE. If you stop running that plugin TinyMCE will provide you with HTML and not bbcode markup.
https://www.tiny.cloud/docs/plugins/opensource/bbcode/

VS Code - HTML tag wrapping issue

Is there a way to make VS Code stop breaking HTML tags before > on a new line? As you can see on the picture the tag is breaking/wrapping on a next line just after the > . I'm Using Prettier - Code formatter.
You could try adding this line to your settings.json file
{
"html.format.wrapAttributes": "force-aligned"
}
I know this is old, but for those who have the same problem, have you checked to ensure that your document is being treated as HTML rather than something else? I've seen this happen when I format my HTML code in a Javascript document.
On the bottom-right of the VS Code window, after Tab Size, UTF-8, and CRLF (your options may be different) you should see HTML. If you see Javascript, CSS, or some other code language, you'll need to click it and change it to HTML.

VSCode Comments aren't inline

I use VSCode and I think its a great editor, but when I write a comment in html it drops to a new line under what I'm commenting which is really irritating.
If I comment a closing div I want it next to the closing div not under it.
I have uninstalled prettier but that made no difference.
Is what I want even possible in VSCode?
Any advise would be appreciated because I am so irritated that I am considering using a different editor (I'm on a Mac just in case it matters).
Thanks in advance.
This was a problem for me too, as were other new line / white space related HTML issues.
Assuming you are not using any formatters besides the native VSCode HTML language features (you said you uninstalled prettier, but you didn't mention whether you were using something else),
there is a setting HTML white space which you can set to preserve to leave your comments untouched.
Note that you may need to go into settings and check what is being used as the HTML default formatter

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.

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.