Entering spaces in the Ace editor leads to special characters

I installed ace editor on my site, and although when I tested it in the dev environment, now with the same code I am experiencing typing errors - especially when hitting space or deleting.

When I press the space bar, strange characters appear. Here is an example of my code and an image of what I see.

$(function(){ var editor = ace.edit("editor"); editor.setTheme("ace/theme/chrome"); editor.getSession().setMode("ace/mode/html"); }); 

Does anyone help?

enter image description here

+6
source share
2 answers

It turned out that this problem is due to the fact that I included the script as:

 <script src="src-min/ace.js"></script> 

and I had to include the following attributes:

 <script src="src-min/ace.js" data-ace-base="src" type="text/javascript" charset="utf-8"></script> 
+11
source

It seems that

 charset="utf-8" 

is an important part.

+1
source

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


All Articles