您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Fixes triple backquote style code blocks in the old reddit layout and can apply syntax highlighting.
Fixes the display of fenced code blocks when using the old reddit layout. For example, the new reddit will allow people to use markup like:
```somelanguage
code_code();
```
Unfortunately, they never updated the old reddit to handle this so it comes out a garbled mess. This userscript attempts to find those comments and fix them. It can also perform syntax highlighting on the code at the same time.
The default settings will run the userscript automatically on page load. Note that currently it does not automatically get reapplied when new comments are loaded or collapsed ones are expanded. It also currently doesn't work in private messages and modmail (not a hard fix, so I can probably do it if someone pokes me).
It should also add an "Apply" action which can be accessed through your userscript manager. This can be used to manually reapply it after loading new content which needs the fix.
See the top of the script source code for possible configuration options. You can prevent it from running automatically, change the syntax highlighting theme (defaults to dark github style), etc. The configuration is stored as a setting in the userscript manager. The exact way to modify it will depend on what you're using, but here's an example with ViolentMonkey: Go like you're going to edit the script, then choose the "values" tab at the top. You can edit the settings in JSON format from there. If you make a mistake or want to reset to the defaults, simple delete the config
key and the userscript will regenerate from the defaults.
@require
line near the top of the script. It will detect highlighting is unavailable regardless of the configuration settings.