
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
@uiw/codemirror-extensions-hyper-link
Advanced tools
Hyper link Extensions for CodeMirror6.
npm install @uiw/codemirror-extensions-hyper-link --save
import { hyperLink, hyperLinkExtension, hyperLinkStyle } from '@uiw/codemirror-extensions-hyper-link';
import CodeMirror from '@uiw/react-codemirror';
import { hyperLink } from '@uiw/codemirror-extensions-hyper-link';
const code = `https://uiwjs.github.io/react-codemirror`;
function App() {
return <CodeMirror value={code} height="200px" extensions={[hyperLink]} />;
}
export default App;
import { EditorView } from '@codemirror/view';
import { EditorState } from '@codemirror/state';
import { hyperLink } from '@uiw/codemirror-extensions-hyper-link';
const code = `https://uiwjs.github.io/react-codemirror`;
const state = EditorState.create({
doc: code,
extensions: [hyperLink],
});
const view = new EditorView({
parent: document.querySelector('#editor'),
state,
});
Custom match content
import { EditorView } from '@codemirror/view';
import { EditorState } from '@codemirror/state';
import { hyperLinkExtension, hyperLinkStyle } from '@uiw/codemirror-extensions-hyper-link';
const code = `Hyper Link\n====`;
export const hyperLink: Extension = [
hyperLinkExtension({
regexp: /Hyper/gi,
match: { Hyper: 'https://google.com' },
handle: (value, input, from, to) => {
if (value === 'Hyper') return 'https://google.com';
return value;
},
}),
hyperLinkStyle,
];
const state = EditorState.create({
doc: code,
extensions: [hyperLink],
});
const view = new EditorView({
parent: document.querySelector('#editor'),
state,
});
import { ViewPlugin, DecorationSet, MatchDecorator, ViewUpdate } from '@codemirror/view';
import { Extension } from '@codemirror/state';
export interface HyperLinkState {
at: number;
url: string;
anchor: HyperLinkExtensionOptions['anchor'];
}
export type HyperLinkExtensionOptions = {
regexp?: RegExp;
match?: Record<string, string>;
handle?: (value: string, input: string, from: number, to: number) => string;
anchor?: (dom: HTMLAnchorElement) => HTMLAnchorElement;
};
export declare function hyperLinkExtension({ regexp, match, handle, anchor }?: HyperLinkExtensionOptions): ViewPlugin<{
decorator?: MatchDecorator | undefined;
decorations: DecorationSet;
update(update: ViewUpdate): void;
}>;
export declare const hyperLinkStyle: Extension;
export declare const hyperLink: Extension;
As always, thanks to our amazing contributors!
Made with github-action-contributors.
Licensed under the MIT License.
FAQs
Hyper link Extensions for CodeMirror6.
The npm package @uiw/codemirror-extensions-hyper-link receives a total of 6,774 weekly downloads. As such, @uiw/codemirror-extensions-hyper-link popularity was classified as popular.
We found that @uiw/codemirror-extensions-hyper-link demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
/Research
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.