kip
April 16, 2022, 4:26pm
1
I have all the needed files included:
The code I have:
<form>
<textarea id="CodeItem4"><?php echo 'hello world';?></textarea>
</form>
<script>
var editor = CodeMirror.fromTextArea(document.getElementById("CodeItem4"), {
mode: "application/x-httpd-php",
theme: "eclipse",
lineNumbers: true,
lineWrapping: true,
styleActiveLine: true,
matchBrackets: true
});
</script>
This is what i get instead of the php code showing.
marijn
April 16, 2022, 4:49pm
2
Are you saying your php code mysteriously changed to the string “hello world” when loaded into the editor? Or are you expecting some kind of different highlighting on that code?
kip
April 16, 2022, 5:07pm
3
Indeed the php gets executed instead of being showed full code in the textarea.
marijn
April 16, 2022, 6:32pm
4
That’s not something CodeMirror can do, so it’s probably happening server-side.
kip
April 16, 2022, 6:51pm
5
Thanks for the reply, gonna see if stackoverflow can help me with that.
You maybe have an answer to my other question about codemirror?
How can i set CodeMirror to keep the tabs equal as the original line?
[image]
So the 2nd $("#chat1") would have the same tab amount as the line it is part of(the first $("#chat1"))