Apply CodeMirror

Applying CodeMirror enables smooth code editing in the editor's "Source View".

'Source View' without CodeMirror applied'Source View' with CodeMirror applied
Without CodeMirrorWith CodeMirror

You can apply CodeMirror by downloading the js and css files from the Code Mirror site and adding paths to them, or by using a CDN.

Alternatively, you can use the codemirror script files included in the externals directory of the Synap Editor package.

How to Apply

Using codemirror.min.js and xml.min.js included in externals/codeMirror

<!-- index.html -->
<!-- code mirror -->
<script type="text/javascript" src="externals/codeMirror/codemirror.min.js"></script>
<script type="text/javascript" src="externals/codeMirror/xml.min.js"></script>
<link rel="stylesheet" href="externals/codeMirror/codemirror.min.css">

Applying via CDN

Add the following to the <head> tag of the html file where the editor is installed.

<!-- index.html -->
<!-- code mirror -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.0/codemirror.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.0/mode/xml/xml.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/5.39.0/codemirror.min.css">