2016-08-21 82 views
0

有沒有辦法在JSON片段中有一些額外的元素時禁用錯誤突出顯示。我的用例是我想將註釋添加到JSON中以使其更易於理解。我知道,這不是語言規範的一部分,但是做這樣的事情沒有紅色的亮點將是非常酷:在Slate中禁用語法錯誤突出顯示

{ 
    // this field contains some textual description of the problem occurred 
    "description": "Resource not found" 
} 

是否可以很容易地影響突出風格,而無需修改包括寶石?

在此先感謝!

回答

0

其實答案很簡單。必須使用json-doc語法高亮顯示。在您的MD文件中:

```json-doc 
    // this field contains some textual description of the problem occurred 
    "description": "Resource not found" 
```