tinymce - Why did my <script> get mangled, and how can I keep from happening again?

I was pulling something fromand found that it did not have any of the dynamically arranged titles. When I went to edi

I was pulling something from / and found that it did not have any of the dynamically arranged titles. When I went to edit the page, I found a surprise.

I had originally entered a hand-typed:

<script src="/wp-content/javascripts/wrapped-book-table.cgi"></script>

However, while the SCRIPT tag was still there, it was mangled:

<script src="/wp-content/javascripts/wrapped-book-table.cgi" type="mce-no/type" data-mce-src="/wp-content/javascripts/wrapped-book-table.cgi"></script>

What converted the first into the second one, and what does "mce" refer to? This is not something I would have entered, and the type of "mce-no/type" probably defeated the JavaScript being treated in JavaScript.

(And what can I do to prevent the transformaation from recurring?)

I was pulling something from https://CJSHayward/books/ and found that it did not have any of the dynamically arranged titles. When I went to edit the page, I found a surprise.

I had originally entered a hand-typed:

<script src="/wp-content/javascripts/wrapped-book-table.cgi"></script>

However, while the SCRIPT tag was still there, it was mangled:

<script src="/wp-content/javascripts/wrapped-book-table.cgi" type="mce-no/type" data-mce-src="/wp-content/javascripts/wrapped-book-table.cgi"></script>

What converted the first into the second one, and what does "mce" refer to? This is not something I would have entered, and the type of "mce-no/type" probably defeated the JavaScript being treated in JavaScript.

(And what can I do to prevent the transformaation from recurring?)

Share Improve this question edited May 11, 2019 at 0:05 fuxia 107k39 gold badges255 silver badges459 bronze badges asked Apr 12, 2017 at 7:42 Christos HaywardChristos Hayward 639 bronze badges 3
  • just a quick question, did you add that into the post or into your template? – marvinpoo Commented Apr 12, 2017 at 7:48
  • 1 Lets repeat together, the editor is for content, not for code :(. – Mark Kaplun Commented Apr 12, 2017 at 8:21
  • @MarkKaplun so true! – marvinpoo Commented Apr 12, 2017 at 8:22
Add a comment  | 

2 Answers 2

Reset to default 0

This is a known bug with TinyMCE. That is the standard text editor in WP. When you hit refresh whilst editing a page it adds those tags to javascript. https://github/tinymce/tinymce/commit/5f320ac2acda15902b0488df1b7d85bf5c24ef94

However it is marked as fixed some time ago (2015) so perhaps your site is not up to date? Or of course perhaps it has resurfaced!

(And what can I do to prevent the transformaation from recurring?)

Start with not putting Javascript into your Editor.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745503928a4630542.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信