Display <script> tag in TinyMCE

I managed to get TinyMCE to save the tag <script>in the source, so it no longer splits as an invalid tag. However, in edit mode, it does not display anything. The script tag is present in the html view, but it's just an empty line in edit mode.

Instead, I want tinyMCE to display something instead of nothing. Even if it's just plain text, like [the script is here]. Is it possible? How? I can’t make it work for me. Thank!

+3
source share
2 answers

You can use styles for script element styles, I would advise trying it in TinyMCE, here is a fiddle so you can see what I mean:

https://jsfiddle.net/plenuM/m9zr1dqw/

script {
 display:block;
 height:20px;
 width:100%;
 background:red;
 text-align:center;
 color:#fff;
 overflow:hidden;
}
script:before {
 content:"(SCRIPT)";
}

CSS , TinyMCE , TinyMCE .

+2

script html.

0

Source: https://habr.com/ru/post/1769372/


All Articles