简体   繁体   English

如何防止github在我的React代码中突出显示撇号

[英]How to prevent github from highlighting apostrophes at my react code

So github is highlighting this part of my code as an error because the apostrophe wont close anywhere. 因此,github将我的代码的这一部分突出显示为错误,因为撇号不会在任何地方关闭。

问题

but the problem is, this is HTML code inside a JS react file, inside the render function. 但是问题是,这是JS react文件中的HTML代码,在render函数中。

an example that would trigger this problem on a github pull request is : 一个将在github pull请求上触发此问题的示例是:

render = () => (
  <a>Signer's Title</a>
)

everything after the apostrophe would be highlighted in red. 撇号后的所有内容将以红色突出显示。

bad solutions : {`'`} or using a JSX file which is dont want to. 错误的解决方案: {`'`}或使用了不想使用的JSX文件。

You are using a single quote ' as an apostrophe. 您正在使用单引号'作为撇号。

I think you could use the apostrophe character ‎' to avoid this. 我认为您可以使用撇号‎'来避免这种情况。

example : 例如:

render = () => (
  <a>Signer’s Title</a>
)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM