- Bear Version: 2.6.7
- OS Version: 15.7.4
- What were you doing: text replacement to insert empty code block
- What feature did you use: text replacement (macOS settings)
- What happened: resulting code block didn’t always format code
- What did you expect to happen: nicely formatted code as usual
I just created two macOS text replacements:
- “.ca”
```applescript
```
- “.cj”
```javascript
```
These text replacements always work, in the sense that the empty code block is generated in the text, with the language specified, as shown above.
However, the code block may or may not format code subsequently pasted into the block, depending on how the replacement text was inserted.
- Entering the text to be replaced (.ca or .cj), and pausing will bring up the suggested replacement text (and an x to cancel) in a “pop over” below the line.
-
If I click on this, then everything works as expected: the code block is generated and subsequently entered code is formatted according to the language.
-
However, if I enter the text, then follow it with a space, the code block is inserted but, in this case, it doesn’t work as expected. When I copy code into the block, it isn’t formatted.

It appears to always not work on iOS, but I haven’t tested that as thoroughly.
