Newcomer here, so my apologies if this has been covered before. When saving a <code> block, any whitespace at the start of a line gets removed when using a textarea or markdown field as a child of a builder field.
Thanks for the reply. Iβve just tried a structure field with both textarea and markdown fields, but the problem persists too. Line breaks are respected but leading whitespaces are stripped:
Hereβs a stopgap solution for anyone who needs it. I keep any code blocks in separate fields from other content for convenience. Probably not the cleanest solution but works ok for me:
In my code field, where a space is needed Iβve put β/\β like so:
@mheys, many thanks for the stopgap solution. I deal with the same issue and implemented the following workaround:
In my code field, I use β-β as a space, which will be replaced by four space characters. To ensure only the β-β characters at the beginning of a line are replaced, I use a simple regex: