Your feedback, positive or negative, is very welcome!
Should you experience any issues, (e.g. false positives, like warning message is shown despite no code at all contained in the post), please let us know in this topic.
If possible, please provide the text that caused the issue so we can reproduce it and possibly report upstream.
I assume footnotes trigger the code block detection as well, as I've been prompted about it while posting https://forum.openwrt.org/t/help-with-loading-linksys-whw01-v1/103793/5,
I only saw false positives so far, but I consider this to be a great idea nevertheless, as it will help newcomers to realise that code formatting is actually an option. Now, if the false positives show up too often, some regulars will be annoyed (me included), but let's see whether this triggers too often before trying to fix it?
I'm just reporting the false positive(s) as I notice them, no complaints from me (not using code blocks where they should be is indeed much worse for every reader, than clicking away the nag screen).
(just for reference, I'm getting nagged about this post as well)
Another false positive is https://forum.openwrt.org/t/unbricking-wdr4300-v1-7/103877/12, after editing the post with last two lines including/ following "-- ".
The code detection triggers on at least half of my (non-code) posts (presumably due to bracket usage, not just footnotes), so it can be a bit annoying as well. Still the net-effect for new users is probably worth it.
Seems it's not clear how to tweak the detection (in this case for adding keywords to be detected, but I guess sensitivity falls in the same range):
Seems that detection is triggered by "download:upload", i.e. the colon between two words. I have noticed that already with Network and Wireless Configuration
It might be useful to add detection for shebang like @vgaetera suggested, plus add OpenWrt specific things like uci config file detection "^config " (although the UCI file might be detected in any case due to use of ' )
Some words from me as an admin: I think this Code Detector component is the best invention since sliced bread!
Many users, even brand new ones, are applying the correct code formatting, without the need for admins to take corrective actions.
The number of posts where I need to add correct code formatting has gone down significantly, leaving me more time to do other stuff. That's great!
It is certainly not perfect (yet), but given the complex task to detect different kinds of code within normal text I feel it does the job pretty good.
Not sure if it needs to be anything more complicated than these added to the non-html section... nonHtmlIndicators
"^root@"
"^config "
"^#!"
I marked all of those to be at the start of the line, as having root@ in the text might be viable. When that is in the beginning of the line, it is almost certainly commands grabbed from console. And not sure about escaping shebang chars )
agree... and once someone gets the hang of it... clicking ignore once... forever removes the pesky warnings and/or false detections... so in the big picture... it's mostly fine...