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

prosemirror-codemark

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prosemirror-codemark - npm Package Compare versions

Comparing version 0.3.2 to 0.3.3

22

dist/actions.js

@@ -40,3 +40,5 @@ "use strict";

const nextCode = !!markType.isInSet((_a = pos.marksAcross((0, utils_1.safeResolve)(doc, selection.from + 1))) !== null && _a !== void 0 ? _a : []);
if (pos.pos === view.state.doc.nodeSize - 3 && (pluginState === null || pluginState === void 0 ? void 0 : pluginState.active)) {
if (pos.pos === view.state.doc.nodeSize - 3 &&
pos.parentOffset === pos.parent.nodeSize - 2 &&
(pluginState === null || pluginState === void 0 ? void 0 : pluginState.active)) {
// Behaviour stops: `code`| at the end of the document

@@ -87,3 +89,9 @@ view.dispatch(view.state.tr.removeStoredMark(markType));

}
if (inCode && nextCode && (pluginState === null || pluginState === void 0 ? void 0 : pluginState.active) && (pluginState === null || pluginState === void 0 ? void 0 : pluginState.side) === 0) {
if ((pluginState === null || pluginState === void 0 ? void 0 : pluginState.side) === 0 && selection.$from.parentOffset === 0) {
// New line!
// ^`|code` --> ^|`code`
view.dispatch(view.state.tr.removeStoredMark(markType));
return true;
}
if (inCode && nextCode && (pluginState === null || pluginState === void 0 ? void 0 : pluginState.side) === 0) {
// `code`| --> `code|`

@@ -133,8 +141,2 @@ view.dispatch(view.state.tr.addStoredMark(markType.create()));

}
if (inCode && !(pluginState === null || pluginState === void 0 ? void 0 : pluginState.active) && selection.$from.parentOffset === 0) {
// Start of line
// ^`|code` --> ^|`code`
view.dispatch(view.state.tr.removeStoredMark(markType));
return true;
}
if (inCode && !nextCode && (pluginState === null || pluginState === void 0 ? void 0 : pluginState.active) && pluginState.side !== -1) {

@@ -159,2 +161,6 @@ // `x`| --> `x|` - Single character

const pos = selection.$from;
const pluginState = plugin.getState(view.state);
if (pos.pos === 1 && pos.parentOffset === 0 && (pluginState === null || pluginState === void 0 ? void 0 : pluginState.side) === -1) {
return true;
}
if (selection.empty && pos.parentOffset === 0) {

@@ -161,0 +167,0 @@ return stepOutsideNextTrAndPass(view, plugin);

{
"name": "prosemirror-codemark",
"version": "0.3.2",
"version": "0.3.3",
"description": "Inline code mark for ProseMirror",

@@ -5,0 +5,0 @@ "author": "Rowan Cockett <rowan@curvenote.com>",

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