Github 将此行中的第二个 %
突出显示为错误:
fscanf(fp, "%d%*[^\n]\n", &ints[i]);
但是,代码可以完美编译,删除“错误”将导致程序无法正常运行。
有什么方法可以禁用此错误突出显示或让 Github 将其识别为正确的吗?
最佳答案
更新:pchaigno指出in the comments本节linguist#Overrides ,您可以在其中使用例如 .gitattributes
:
Add a
.gitattributes
file to your project and use standard git-style path matchers for the files you want to override to set linguist-documentation,linguist-language
,linguist-vendored
, andlinguist-generated
..gitattributes
will be used to determine language statistics and will be used to syntax highlight files. You can also manually set syntax highlighting using Vim or Emacs modelines.
$ cat .gitattributes
*.rb linguist-language=Java
2017 年 1 月的原始答案
由于您无法轻松删除 GitHub 突出显示,您可以尝试使用我在“How to fix/ignore syntax error in github”中建议的类似解决方法
尝试在同一行中添加一个带有 '%
' 的注释,以便词法分析器(由语法高亮引擎 Rouge 和 Pygment 使用)不传播所有后续行的“错误”。
关于github - 有什么方法可以禁用 Github 中的错误突出显示吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41604413/