Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@patternslib/pat-code-editor
Advanced tools
This is code editor pattern based on CodeJar and PrismJS.
Note:
When prefilling the textarea, please add HTML escaped content to the template to avoid any XSS security issues or nesting errors with existing HTML.
Example to escape content in Python:
import html
escaped_html = html.escape(unescaped_html)
Example to escape content in JavaScript:
const escaped_html = unescaped_html
.replaceAll("&", "&")
.replaceAll("<", "<")
.replaceAll(">", ">")
.replaceAll(""", '"');
Property | Default Value | Type | Description |
---|---|---|---|
language | null | String, null | Programming language to use. |
linenumbers | false | Boolean | Show line numbers. |
theme | null | String | Name of PrismJS theme. |
tab | "' '" | String | Characters to use as tab. Use "\t" for a tab character, spaces in quotes (e.g. "' '") for spaces |
indent-on | {$ | String | Regex pattern where the next line is indented. |
spellcheck | false | Boolean | Activate spellchecking. |
catch-tab | true | Boolean | Catch a tab keystroke and indent. |
preserve-indent | true | Boolean | Preserve indentation of original source. |
add-closing | true | Boolean | Automatically add closing brackets. |
history | true | Boolean | Activate undo history. |
<div class="pat-code-editor" data-pat-code-editor="language: javascript" contenteditable>
import Pattern from "./code-editor";
Pattern.init(document.querySelector(".pat-code-editor"));
</div>
This will create a div where the code editor is finally initialized and changes are synchronized back to the text editor.
body { background-color: black; color: blue; }<textarea class="pat-code-editor" data-pat-code-editor="language: css">
body {
background-color: black;
color: blue;
}
</textarea>
FAQs
A pattern for a code-editor
The npm package @patternslib/pat-code-editor receives a total of 16 weekly downloads. As such, @patternslib/pat-code-editor popularity was classified as not popular.
We found that @patternslib/pat-code-editor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.