Unformatted Code Detector

Is there any way we can make it more clear to the user which key to chose for the code fences if he is doing it manually (i.e. not via the button)?

Today I have seen this:

The user obviously tried to follow the instructions, but chose the wrong key for the code fences ( ' instead of `). In the past I have also seen ... instead of ```. Both cases indicate that users need more explicit instructions which key to choose.

Alternatively: Don’t confuse users with those keys and just say: Use the “Preformatted text” button and you are done.


@lionel-rowe How can I customize the detection behaviour?

Currently the shebang is not detected as code, and I would like to change this.

Expected behaviour: #! indicates the beginning of a script and therefore should be detected as code.

Example for non-detection:


#!/bin/sh

echo “test”

. /lib/upgrade/common.sh

firmware="/tmp/firmware.img"
tmpdir="/tmp/_upgrade"
output="/dev/ttyS0"
before=“before-upgrade.sh”
after=“after-upgrade.sh”


In addition to this, it would be useful for us if root@ would be detected as code.

root@OpenWrt:~# ip link add link eth0 name eth0.9 type vlan id 9
root@OpenWrt:~# brctl addbr br-foo
root@OpenWrt:~# brctl addif br-foo eth0.9
root@OpenWrt:~# ip link set eth0.9 up
root@OpenWrt:~# ip link set br-foo up

4 Likes