Page tree
Skip to end of metadata
Go to start of metadata

By applying Code Mirror, you can more easily edit codes at 'view source' of the Editor.

'view source' without Code Mirror'view source' with Code Mirror

You may apply Code Mirror by either downloading js file and css file from Code Mirror website and adding the corresponding path or using CDN.
Or, you may also use codemirror script file included in externals directory in SynapEditor package.

Using package externals

Using externals codeMirror script file under package

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


Application through CDN

The the following script to <head> tag in html file in which 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'>
  • No labels