Closed logut closed 1 year ago
@logut, note that the CDN you have is wrong. It should be:
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mergely/5.0.0/mergely.min.js"></script>
<link type="text/css" rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mergely/5.0.0/mergely.css" />
But I also could not get mode
working. I think it is an unintentional consequence of bundling codemirror. I will need to look into a way to try to make it work.
@logut, released 5.1 that adds support for mode
. You do not need to load the mode from CDN, just specify the mode during in options.cmsettings:
const mergely = new Mergely('#compare', {
cmsettings: {
mode: 'javascript'
}
});
Thanks for reporting the issue.
When using CDN to load Mergely, there is no access to the CodeMirror object so using modes like https://github.com/codemirror/codemirror5/blob/master/mode/javascript/javascript.js doesn't work
for example
results in :
Is there a way to add modes when using the CDN install ?