final List<AbstractBlock> blocks = this.document.blocks();
for (int i = 0; i < blocks.size(); i++) {
final AbstractBlock currentBlock = blocks.get(i);
if(currentBlock instanceof Block) {
Block block = (Block)currentBlock;
List<String> lines = block.lines();
if (lines.size() > 0 && lines.get(0).startsWith("$")) {
blocks.set(
i, convertToTerminalListing(block));
}