本文介绍了GitHub比较视图中的红色文本背景是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个拉取请求并浏览完毕,差异显示为浅红色/绿色线框,但有些文本以粗体显示红色文字背景...



更新:图像更改为显示带有某些高亮注释的文件,有些则不显示。



这是什么意思?

解决方案

红色背景颜色肯定是由GitHub的错误高亮功能引起的文本编辑器/查看器。您可以在为例:





In在这种情况下,最外面的对象外面的文本没有被突出显示。无论出于何种原因,这可能与错误未被突出显示的原因相同。



您可以通过将代码复制粘贴到一个。请注意,ACE编辑器具有自己的突出显示功能,可以在键入时突出显示代码,但其处理规则似乎与GitHub的代码查看器有所不同。


I created a pull request and was browsing through, the differences are shown with light red/green line-brackgrounds, but some text is bolded with a red text background...

Update: Image changed to show file with some highlighted comments and some not.

What does this mean?

解决方案

The red background-color is definitely being caused by the error-highlighting feature of GitHub's text editor/viewer. You can find the same behaviour occurring to an intended block comment in another JSON file on GitHub:

As for your comment about some illegal characters not being highlighted: I also found that certain JSON errors aren't caught by GitHub's syntax processor. See this gist as an example:

In this case, the text outside of the outermost object isn't being highlighted. Whatever reason there is for this may be the same reason that errors aren't being highlighted for you.

You can test it out for yourself by copy-pasting your code into a new Gist. Note that the ACE Editor has its own highlighting feature that can highlight code as you type, but its processing rules seem to be a bit different from that of GitHub's code viewer.

这篇关于GitHub比较视图中的红色文本背景是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 19:37