Wrong code format displayed in website
calebeso opened this issue · 2 comments
calebeso commented
daftspunk commented
Hi @calebeso
This is because the frontend and backend are using a different theme. If you are using the demo theme, take a look at the javascript/app.js
file and see where it activates code formatting:
/*
* Init code blocks
*/
$('pre').each(function () {
var $this = $(this),
$code = $this.html(),
originalValue = $this.html(),
unescaped = originalValue.replace(/</g, "<").replace(/>/g, ">")
$this.empty()
var cm = new CodeMirror(this, {
value: $code,
mode: 'twig',
htmlMode: true,
lineNumbers: true,
readOnly: true
})
cm.setValue(unescaped)
})
You can apply a different theme here. These themes are supported: https://codemirror.net/demo/theme.html
I hope this helps!
calebeso commented
Thanks for replying!
Problem solved!