Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@expressive-code/plugin-frames

Package Overview
Dependencies
Maintainers
1
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@expressive-code/plugin-frames - npm Package Compare versions

Comparing version 0.19.2 to 0.20.0

8

dist/index.d.ts

@@ -27,2 +27,10 @@ import { StyleSettings, PluginTexts, ExpressiveCodePlugin, AttachedPluginData } from '@expressive-code/core';

showCopyToClipboardButton?: boolean | undefined;
/**
* If this is true (default), the "Copy to clipboard" button of terminal window frames
* will remove comment lines starting with `#` from the copied text.
*
* This is useful to reduce the copied text to the actual commands users need to run,
* instead of also copying explanatory comments or instructions.
*/
removeCommentsWhenCopyingTerminalFrames?: boolean | undefined;
styleOverrides?: Partial<typeof framesStyleSettings.defaultSettings> | undefined;

@@ -29,0 +37,0 @@ }

7

dist/index.js

@@ -520,2 +520,3 @@ // src/index.ts

showCopyToClipboardButton: true,
removeCommentsWhenCopyingTerminalFrames: true,
...options

@@ -581,3 +582,7 @@ };

if (options.showCopyToClipboardButton) {
const codeToCopy = codeBlock.code.replace(/\n/g, "\x7F");
let codeToCopy = codeBlock.code;
if (options.removeCommentsWhenCopyingTerminalFrames && isTerminal) {
codeToCopy = codeToCopy.replace(/(?<=^|\n)\s*#.*($|\n+)/g, "").trim();
}
codeToCopy = codeToCopy.replace(/\n/g, "\x7F");
extraElements.push(

@@ -584,0 +589,0 @@ h("div", { className: "copy" }, [

6

package.json
{
"name": "@expressive-code/plugin-frames",
"version": "0.19.2",
"version": "0.20.0",
"description": "Frames plugin for Expressive Code. Wraps code blocks in a styled editor or terminal frame with support for titles, multiple tabs and more.",

@@ -26,3 +26,3 @@ "keywords": [],

"dependencies": {
"@expressive-code/core": "^0.19.2",
"@expressive-code/core": "^0.20.0",
"hastscript": "^7.2.0"

@@ -33,3 +33,3 @@ },

"hast-util-to-html": "^8.0.4",
"@internal/test-utils": "^0.2.12"
"@internal/test-utils": "^0.2.13"
},

@@ -36,0 +36,0 @@ "scripts": {

@@ -190,2 +190,12 @@ # @expressive-code/plugin-frames

- `showCopyToClipboardButton: boolean`
If `true` (which is the default), a "Copy to clipboard" button will be shown for each code block.
- `removeCommentsWhenCopyingTerminalFrames: boolean`
If `true` (which is the default), the "Copy to clipboard" button of terminal window frames will remove comment lines starting with `#` from the copied text.
This is useful to reduce the copied text to the actual commands users need to run, instead of also copying explanatory comments or instructions.
- `styleOverrides`

@@ -192,0 +202,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc