Add hyperlink injection to JSON

This commit is contained in:
Andrew Dupont 2024-01-08 17:57:59 -08:00
parent ebd0ae0383
commit e2da555079
2 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,13 @@
exports.activate = () => {
const HYPERLINK_PATTERN = /\bhttps?:/
atom.grammars.addInjectionPoint('source.json', {
type: 'string_content',
language: (node) => {
return HYPERLINK_PATTERN.test(node.text) ? 'hyperlink' : undefined;
},
content: (node) => node,
languageScope: null
});
};

View File

@ -1,5 +1,6 @@
{
"name": "language-json",
"main": "lib/main",
"version": "1.0.5",
"description": "JSON language support in Atom",
"engines": {