I think you are looking for code fences.
How to use code fences - Tutorials & Examples - openHAB Community