I'm trying to set us the Rich Text Editor for inputting code snippets. I've almost got it working except when I go back to edit the entry Redactor removes spaces I entered to format the code. Also setting the tabAsSpaces doesn't seem to work. It still adds tab space.
Here is what I have in Redactor config.json
{
toolbar: false,
visual: false,
tabAsSpaces: 2,
cleanOnPaste: false,
cleanSpaces: false,
cleanStyleOnEnter: true,
paragraphize: false,
minHeight: 200
}
And in the template
{% spaceless %}
<pre>
<code>
{{- block.html|replace({'&':'&', '<':'<', '>':'>'})|raw -}}
</code>
</pre>
{% endspaceless %}