mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-11 11:15:24 +03:00
Add hyperlink injection to JSON
This commit is contained in:
parent
ebd0ae0383
commit
e2da555079
13
packages/language-json/lib/main.js
Normal file
13
packages/language-json/lib/main.js
Normal 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
|
||||
});
|
||||
|
||||
};
|
@ -1,5 +1,6 @@
|
||||
{
|
||||
"name": "language-json",
|
||||
"main": "lib/main",
|
||||
"version": "1.0.5",
|
||||
"description": "JSON language support in Atom",
|
||||
"engines": {
|
||||
|
Loading…
Reference in New Issue
Block a user