@atlaskit/editor-plugin-paste 7.4.14 → 7.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/cjs/pm-plugins/main.js +7 -0
- package/dist/cjs/pm-plugins/util/index.js +31 -59
- package/dist/es2019/pm-plugins/main.js +8 -1
- package/dist/es2019/pm-plugins/util/index.js +31 -59
- package/dist/esm/pm-plugins/main.js +8 -1
- package/dist/esm/pm-plugins/util/index.js +31 -59
- package/package.json +9 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-paste
|
|
2
2
|
|
|
3
|
+
## 7.4.16
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`79172823f4e47`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/79172823f4e47) -
|
|
8
|
+
[ux] EDITOR-3961 strip breakout mark from renderer sync block html
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 7.4.15
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`d23b93a4296a9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d23b93a4296a9) -
|
|
16
|
+
[ux] Clean FG for platform_editor_paste_code_fence_spaces
|
|
17
|
+
|
|
3
18
|
## 7.4.14
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -18,6 +18,7 @@ var _nesting = require("@atlaskit/editor-common/nesting");
|
|
|
18
18
|
var _paste = require("@atlaskit/editor-common/paste");
|
|
19
19
|
var _measureRender = require("@atlaskit/editor-common/performance/measure-render");
|
|
20
20
|
var _safePlugin = require("@atlaskit/editor-common/safe-plugin");
|
|
21
|
+
var _syncBlock = require("@atlaskit/editor-common/sync-block");
|
|
21
22
|
var _transforms = require("@atlaskit/editor-common/transforms");
|
|
22
23
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
23
24
|
var _editorMarkdownTransformer = require("@atlaskit/editor-markdown-transformer");
|
|
@@ -624,6 +625,12 @@ function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFlags, pl
|
|
|
624
625
|
|
|
625
626
|
// Fix for ED-13568: Code blocks being copied/pasted when next to each other get merged
|
|
626
627
|
pastedFromBitBucket = html.indexOf('data-qa="code-line"') >= 0;
|
|
628
|
+
|
|
629
|
+
// Remove breakout marks HTML around sync block renderer nodes
|
|
630
|
+
// so the breakout mark doesn't get applied to the wrong nodes
|
|
631
|
+
if (html.indexOf(_syncBlock.SyncBlockRendererDataAttributeName) >= 0 && (0, _experiments.editorExperiment)('platform_synced_block', true)) {
|
|
632
|
+
html = (0, _transforms.removeBreakoutFromRendererSyncBlockHTML)(html);
|
|
633
|
+
}
|
|
627
634
|
mostRecentPasteEvent = null;
|
|
628
635
|
return html;
|
|
629
636
|
}
|
|
@@ -28,7 +28,6 @@ var _state = require("@atlaskit/editor-prosemirror/state");
|
|
|
28
28
|
var _utils2 = require("@atlaskit/editor-prosemirror/utils");
|
|
29
29
|
var _utils3 = require("@atlaskit/editor-tables/utils");
|
|
30
30
|
var _mediaClient = require("@atlaskit/media-client");
|
|
31
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
32
31
|
function isPastedFromWord(html) {
|
|
33
32
|
return !!html && html.indexOf('urn:schemas-microsoft-com:office:word') >= 0;
|
|
34
33
|
}
|
|
@@ -121,66 +120,39 @@ function escapeLinks(text) {
|
|
|
121
120
|
* const output = escapeBackslashAndLinksExceptCodeBlock(input); // 'This is a link: <https://example.com> and a backslash: \\\\\n```\ncode block https://example.com not escaped\ncode block \\ not escaped\n```'
|
|
122
121
|
*/
|
|
123
122
|
function escapeBackslashAndLinksExceptCodeBlock(textInput) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}
|
|
123
|
+
// ref: https://spec.commonmark.org/0.31.2/#fenced-code-blocks
|
|
124
|
+
// Allows up to 3 leading spaces before ``` and optional trailing characters
|
|
125
|
+
// Ignored via go/ees005
|
|
126
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
127
|
+
var openingCodeFenceRegex = /^( {0,3})```.*$/;
|
|
128
|
+
// Allows up to 3 leading spaces before ``` and optional trailing spaces or tabs
|
|
129
|
+
// Ignored via go/ees005
|
|
130
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
131
|
+
var closingCodeFenceRegex = /^( {0,3})```[ \t]*$/;
|
|
132
|
+
var isInsideCodeBlock = false;
|
|
133
|
+
var lines = textInput.split('\n');
|
|
134
|
+
// In the splitted array, we traverse through every line and check if it will be parsed as a codeblock.
|
|
135
|
+
return lines.map(function (line) {
|
|
136
|
+
if (!isInsideCodeBlock && openingCodeFenceRegex.test(line)) {
|
|
137
|
+
isInsideCodeBlock = true;
|
|
138
|
+
return line;
|
|
139
|
+
}
|
|
140
|
+
if (isInsideCodeBlock && closingCodeFenceRegex.test(line)) {
|
|
141
|
+
isInsideCodeBlock = false;
|
|
142
|
+
return line;
|
|
143
|
+
}
|
|
146
144
|
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
return line;
|
|
150
|
-
} else {
|
|
151
|
-
// Ignored via go/ees005
|
|
152
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
153
|
-
var escaped = line.replace(/\\/g, '\\\\');
|
|
154
|
-
escaped = escapeLinks(escaped);
|
|
155
|
-
return escaped;
|
|
156
|
-
}
|
|
157
|
-
}).join('\n');
|
|
158
|
-
} else {
|
|
159
|
-
var codeToken = '```';
|
|
160
|
-
var _isInsideCodeBlock = false;
|
|
161
|
-
var _lines = textInput.split('\n');
|
|
162
|
-
// In the splitted array, we traverse through every line and check if it will be parsed as a codeblock.
|
|
163
|
-
return _lines.map(function (line) {
|
|
164
|
-
if (line === codeToken) {
|
|
165
|
-
// Toggle code block state
|
|
166
|
-
_isInsideCodeBlock = !_isInsideCodeBlock;
|
|
167
|
-
return line;
|
|
168
|
-
} else if (line.startsWith(codeToken) && !_isInsideCodeBlock) {
|
|
169
|
-
// if there is some text after the ``` mark , it gets counted as language attribute only at the start of codeblock
|
|
170
|
-
_isInsideCodeBlock = true;
|
|
171
|
-
return line;
|
|
172
|
-
}
|
|
173
|
-
if (!_isInsideCodeBlock) {
|
|
174
|
-
// Only escape outside code blocks
|
|
175
|
-
// Ignored via go/ees005
|
|
176
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
177
|
-
var escaped = line.replace(/\\/g, '\\\\');
|
|
178
|
-
escaped = escapeLinks(escaped);
|
|
179
|
-
return escaped;
|
|
180
|
-
}
|
|
145
|
+
// not code fence, don't escape anything inside code block
|
|
146
|
+
if (isInsideCodeBlock) {
|
|
181
147
|
return line;
|
|
182
|
-
}
|
|
183
|
-
|
|
148
|
+
} else {
|
|
149
|
+
// Ignored via go/ees005
|
|
150
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
151
|
+
var escaped = line.replace(/\\/g, '\\\\');
|
|
152
|
+
escaped = escapeLinks(escaped);
|
|
153
|
+
return escaped;
|
|
154
|
+
}
|
|
155
|
+
}).join('\n');
|
|
184
156
|
}
|
|
185
157
|
function hasOnlyNodesOfType() {
|
|
186
158
|
for (var _len = arguments.length, nodeTypes = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
@@ -8,7 +8,8 @@ import { isNestedTablesSupported } from '@atlaskit/editor-common/nesting';
|
|
|
8
8
|
import { isPastedFile as isPastedFileFromEvent, md } from '@atlaskit/editor-common/paste';
|
|
9
9
|
import { measureRender } from '@atlaskit/editor-common/performance/measure-render';
|
|
10
10
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
11
|
-
import {
|
|
11
|
+
import { SyncBlockRendererDataAttributeName } from '@atlaskit/editor-common/sync-block';
|
|
12
|
+
import { transformSingleColumnLayout, transformSingleLineCodeBlockToCodeMark, transformSliceNestedExpandToExpand, transformSliceToDecisionList, transformSliceToJoinAdjacentCodeBlocks, transformSliceToRemoveLegacyContentMacro, transformSliceToRemoveMacroId, transformSyncBlock, removeBreakoutFromRendererSyncBlockHTML } from '@atlaskit/editor-common/transforms';
|
|
12
13
|
import { containsAnyAnnotations, extractSliceFromStep, linkifyContent, mapChildren } from '@atlaskit/editor-common/utils';
|
|
13
14
|
import { MarkdownTransformer } from '@atlaskit/editor-markdown-transformer';
|
|
14
15
|
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
@@ -586,6 +587,12 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
586
587
|
|
|
587
588
|
// Fix for ED-13568: Code blocks being copied/pasted when next to each other get merged
|
|
588
589
|
pastedFromBitBucket = html.indexOf('data-qa="code-line"') >= 0;
|
|
590
|
+
|
|
591
|
+
// Remove breakout marks HTML around sync block renderer nodes
|
|
592
|
+
// so the breakout mark doesn't get applied to the wrong nodes
|
|
593
|
+
if (html.indexOf(SyncBlockRendererDataAttributeName) >= 0 && editorExperiment('platform_synced_block', true)) {
|
|
594
|
+
html = removeBreakoutFromRendererSyncBlockHTML(html);
|
|
595
|
+
}
|
|
589
596
|
mostRecentPasteEvent = null;
|
|
590
597
|
return html;
|
|
591
598
|
}
|
|
@@ -6,7 +6,6 @@ import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state
|
|
|
6
6
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
7
7
|
import { getSelectedTableInfo, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
8
8
|
import { isMediaBlobUrl } from '@atlaskit/media-client';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
9
|
export function isPastedFromWord(html) {
|
|
11
10
|
return !!html && html.indexOf('urn:schemas-microsoft-com:office:word') >= 0;
|
|
12
11
|
}
|
|
@@ -99,66 +98,39 @@ export function escapeLinks(text) {
|
|
|
99
98
|
* const output = escapeBackslashAndLinksExceptCodeBlock(input); // 'This is a link: <https://example.com> and a backslash: \\\\\n```\ncode block https://example.com not escaped\ncode block \\ not escaped\n```'
|
|
100
99
|
*/
|
|
101
100
|
export function escapeBackslashAndLinksExceptCodeBlock(textInput) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
101
|
+
// ref: https://spec.commonmark.org/0.31.2/#fenced-code-blocks
|
|
102
|
+
// Allows up to 3 leading spaces before ``` and optional trailing characters
|
|
103
|
+
// Ignored via go/ees005
|
|
104
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
105
|
+
const openingCodeFenceRegex = /^( {0,3})```.*$/;
|
|
106
|
+
// Allows up to 3 leading spaces before ``` and optional trailing spaces or tabs
|
|
107
|
+
// Ignored via go/ees005
|
|
108
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
109
|
+
const closingCodeFenceRegex = /^( {0,3})```[ \t]*$/;
|
|
110
|
+
let isInsideCodeBlock = false;
|
|
111
|
+
const lines = textInput.split('\n');
|
|
112
|
+
// In the splitted array, we traverse through every line and check if it will be parsed as a codeblock.
|
|
113
|
+
return lines.map(line => {
|
|
114
|
+
if (!isInsideCodeBlock && openingCodeFenceRegex.test(line)) {
|
|
115
|
+
isInsideCodeBlock = true;
|
|
116
|
+
return line;
|
|
117
|
+
}
|
|
118
|
+
if (isInsideCodeBlock && closingCodeFenceRegex.test(line)) {
|
|
119
|
+
isInsideCodeBlock = false;
|
|
120
|
+
return line;
|
|
121
|
+
}
|
|
124
122
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
return line;
|
|
128
|
-
} else {
|
|
129
|
-
// Ignored via go/ees005
|
|
130
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
131
|
-
let escaped = line.replace(/\\/g, '\\\\');
|
|
132
|
-
escaped = escapeLinks(escaped);
|
|
133
|
-
return escaped;
|
|
134
|
-
}
|
|
135
|
-
}).join('\n');
|
|
136
|
-
} else {
|
|
137
|
-
const codeToken = '```';
|
|
138
|
-
let isInsideCodeBlock = false;
|
|
139
|
-
const lines = textInput.split('\n');
|
|
140
|
-
// In the splitted array, we traverse through every line and check if it will be parsed as a codeblock.
|
|
141
|
-
return lines.map(line => {
|
|
142
|
-
if (line === codeToken) {
|
|
143
|
-
// Toggle code block state
|
|
144
|
-
isInsideCodeBlock = !isInsideCodeBlock;
|
|
145
|
-
return line;
|
|
146
|
-
} else if (line.startsWith(codeToken) && !isInsideCodeBlock) {
|
|
147
|
-
// if there is some text after the ``` mark , it gets counted as language attribute only at the start of codeblock
|
|
148
|
-
isInsideCodeBlock = true;
|
|
149
|
-
return line;
|
|
150
|
-
}
|
|
151
|
-
if (!isInsideCodeBlock) {
|
|
152
|
-
// Only escape outside code blocks
|
|
153
|
-
// Ignored via go/ees005
|
|
154
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
155
|
-
let escaped = line.replace(/\\/g, '\\\\');
|
|
156
|
-
escaped = escapeLinks(escaped);
|
|
157
|
-
return escaped;
|
|
158
|
-
}
|
|
123
|
+
// not code fence, don't escape anything inside code block
|
|
124
|
+
if (isInsideCodeBlock) {
|
|
159
125
|
return line;
|
|
160
|
-
}
|
|
161
|
-
|
|
126
|
+
} else {
|
|
127
|
+
// Ignored via go/ees005
|
|
128
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
129
|
+
let escaped = line.replace(/\\/g, '\\\\');
|
|
130
|
+
escaped = escapeLinks(escaped);
|
|
131
|
+
return escaped;
|
|
132
|
+
}
|
|
133
|
+
}).join('\n');
|
|
162
134
|
}
|
|
163
135
|
export function hasOnlyNodesOfType(...nodeTypes) {
|
|
164
136
|
return slice => {
|
|
@@ -13,7 +13,8 @@ import { isNestedTablesSupported } from '@atlaskit/editor-common/nesting';
|
|
|
13
13
|
import { isPastedFile as isPastedFileFromEvent, md } from '@atlaskit/editor-common/paste';
|
|
14
14
|
import { measureRender } from '@atlaskit/editor-common/performance/measure-render';
|
|
15
15
|
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
16
|
-
import {
|
|
16
|
+
import { SyncBlockRendererDataAttributeName } from '@atlaskit/editor-common/sync-block';
|
|
17
|
+
import { transformSingleColumnLayout, transformSingleLineCodeBlockToCodeMark, transformSliceNestedExpandToExpand, transformSliceToDecisionList, transformSliceToJoinAdjacentCodeBlocks, transformSliceToRemoveLegacyContentMacro, transformSliceToRemoveMacroId, transformSyncBlock, removeBreakoutFromRendererSyncBlockHTML } from '@atlaskit/editor-common/transforms';
|
|
17
18
|
import { containsAnyAnnotations, extractSliceFromStep, linkifyContent, mapChildren } from '@atlaskit/editor-common/utils';
|
|
18
19
|
import { MarkdownTransformer } from '@atlaskit/editor-markdown-transformer';
|
|
19
20
|
import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
|
|
@@ -616,6 +617,12 @@ export function createPlugin(schema, dispatchAnalyticsEvent, dispatch, featureFl
|
|
|
616
617
|
|
|
617
618
|
// Fix for ED-13568: Code blocks being copied/pasted when next to each other get merged
|
|
618
619
|
pastedFromBitBucket = html.indexOf('data-qa="code-line"') >= 0;
|
|
620
|
+
|
|
621
|
+
// Remove breakout marks HTML around sync block renderer nodes
|
|
622
|
+
// so the breakout mark doesn't get applied to the wrong nodes
|
|
623
|
+
if (html.indexOf(SyncBlockRendererDataAttributeName) >= 0 && editorExperiment('platform_synced_block', true)) {
|
|
624
|
+
html = removeBreakoutFromRendererSyncBlockHTML(html);
|
|
625
|
+
}
|
|
619
626
|
mostRecentPasteEvent = null;
|
|
620
627
|
return html;
|
|
621
628
|
}
|
|
@@ -7,7 +7,6 @@ import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state
|
|
|
7
7
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
8
8
|
import { getSelectedTableInfo, isTableSelected } from '@atlaskit/editor-tables/utils';
|
|
9
9
|
import { isMediaBlobUrl } from '@atlaskit/media-client';
|
|
10
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
10
|
export function isPastedFromWord(html) {
|
|
12
11
|
return !!html && html.indexOf('urn:schemas-microsoft-com:office:word') >= 0;
|
|
13
12
|
}
|
|
@@ -100,66 +99,39 @@ export function escapeLinks(text) {
|
|
|
100
99
|
* const output = escapeBackslashAndLinksExceptCodeBlock(input); // 'This is a link: <https://example.com> and a backslash: \\\\\n```\ncode block https://example.com not escaped\ncode block \\ not escaped\n```'
|
|
101
100
|
*/
|
|
102
101
|
export function escapeBackslashAndLinksExceptCodeBlock(textInput) {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
}
|
|
102
|
+
// ref: https://spec.commonmark.org/0.31.2/#fenced-code-blocks
|
|
103
|
+
// Allows up to 3 leading spaces before ``` and optional trailing characters
|
|
104
|
+
// Ignored via go/ees005
|
|
105
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
106
|
+
var openingCodeFenceRegex = /^( {0,3})```.*$/;
|
|
107
|
+
// Allows up to 3 leading spaces before ``` and optional trailing spaces or tabs
|
|
108
|
+
// Ignored via go/ees005
|
|
109
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
110
|
+
var closingCodeFenceRegex = /^( {0,3})```[ \t]*$/;
|
|
111
|
+
var isInsideCodeBlock = false;
|
|
112
|
+
var lines = textInput.split('\n');
|
|
113
|
+
// In the splitted array, we traverse through every line and check if it will be parsed as a codeblock.
|
|
114
|
+
return lines.map(function (line) {
|
|
115
|
+
if (!isInsideCodeBlock && openingCodeFenceRegex.test(line)) {
|
|
116
|
+
isInsideCodeBlock = true;
|
|
117
|
+
return line;
|
|
118
|
+
}
|
|
119
|
+
if (isInsideCodeBlock && closingCodeFenceRegex.test(line)) {
|
|
120
|
+
isInsideCodeBlock = false;
|
|
121
|
+
return line;
|
|
122
|
+
}
|
|
125
123
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
return line;
|
|
129
|
-
} else {
|
|
130
|
-
// Ignored via go/ees005
|
|
131
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
132
|
-
var escaped = line.replace(/\\/g, '\\\\');
|
|
133
|
-
escaped = escapeLinks(escaped);
|
|
134
|
-
return escaped;
|
|
135
|
-
}
|
|
136
|
-
}).join('\n');
|
|
137
|
-
} else {
|
|
138
|
-
var codeToken = '```';
|
|
139
|
-
var _isInsideCodeBlock = false;
|
|
140
|
-
var _lines = textInput.split('\n');
|
|
141
|
-
// In the splitted array, we traverse through every line and check if it will be parsed as a codeblock.
|
|
142
|
-
return _lines.map(function (line) {
|
|
143
|
-
if (line === codeToken) {
|
|
144
|
-
// Toggle code block state
|
|
145
|
-
_isInsideCodeBlock = !_isInsideCodeBlock;
|
|
146
|
-
return line;
|
|
147
|
-
} else if (line.startsWith(codeToken) && !_isInsideCodeBlock) {
|
|
148
|
-
// if there is some text after the ``` mark , it gets counted as language attribute only at the start of codeblock
|
|
149
|
-
_isInsideCodeBlock = true;
|
|
150
|
-
return line;
|
|
151
|
-
}
|
|
152
|
-
if (!_isInsideCodeBlock) {
|
|
153
|
-
// Only escape outside code blocks
|
|
154
|
-
// Ignored via go/ees005
|
|
155
|
-
// eslint-disable-next-line require-unicode-regexp
|
|
156
|
-
var escaped = line.replace(/\\/g, '\\\\');
|
|
157
|
-
escaped = escapeLinks(escaped);
|
|
158
|
-
return escaped;
|
|
159
|
-
}
|
|
124
|
+
// not code fence, don't escape anything inside code block
|
|
125
|
+
if (isInsideCodeBlock) {
|
|
160
126
|
return line;
|
|
161
|
-
}
|
|
162
|
-
|
|
127
|
+
} else {
|
|
128
|
+
// Ignored via go/ees005
|
|
129
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
130
|
+
var escaped = line.replace(/\\/g, '\\\\');
|
|
131
|
+
escaped = escapeLinks(escaped);
|
|
132
|
+
return escaped;
|
|
133
|
+
}
|
|
134
|
+
}).join('\n');
|
|
163
135
|
}
|
|
164
136
|
export function hasOnlyNodesOfType() {
|
|
165
137
|
for (var _len = arguments.length, nodeTypes = new Array(_len), _key = 0; _key < _len; _key++) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-paste",
|
|
3
|
-
"version": "7.4.
|
|
3
|
+
"version": "7.4.16",
|
|
4
4
|
"description": "Paste plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"sideEffects": false,
|
|
28
28
|
"atlaskit:src": "src/index.ts",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@atlaskit/adf-schema": "^51.5.
|
|
31
|
-
"@atlaskit/code": "^17.
|
|
30
|
+
"@atlaskit/adf-schema": "^51.5.0",
|
|
31
|
+
"@atlaskit/code": "^17.4.0",
|
|
32
32
|
"@atlaskit/editor-markdown-transformer": "^5.20.0",
|
|
33
33
|
"@atlaskit/editor-plugin-analytics": "^6.2.0",
|
|
34
34
|
"@atlaskit/editor-plugin-annotation": "^6.3.0",
|
|
@@ -36,28 +36,28 @@
|
|
|
36
36
|
"@atlaskit/editor-plugin-card": "^11.5.0",
|
|
37
37
|
"@atlaskit/editor-plugin-feature-flags": "^5.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-list": "^8.2.0",
|
|
39
|
-
"@atlaskit/editor-plugin-media": "^8.
|
|
39
|
+
"@atlaskit/editor-plugin-media": "^8.7.0",
|
|
40
40
|
"@atlaskit/editor-plugin-mentions": "^8.2.0",
|
|
41
|
-
"@atlaskit/editor-prosemirror": "7.
|
|
41
|
+
"@atlaskit/editor-prosemirror": "^7.2.0",
|
|
42
42
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
43
43
|
"@atlaskit/insm": "^0.2.0",
|
|
44
|
-
"@atlaskit/media-client": "^35.
|
|
44
|
+
"@atlaskit/media-client": "^35.7.0",
|
|
45
45
|
"@atlaskit/media-common": "^12.3.0",
|
|
46
46
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
47
47
|
"@atlaskit/prosemirror-history": "^0.2.0",
|
|
48
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
48
|
+
"@atlaskit/tmp-editor-statsig": "^16.0.0",
|
|
49
49
|
"@babel/runtime": "^7.0.0",
|
|
50
50
|
"lodash": "^4.17.21",
|
|
51
51
|
"react-intl-next": "npm:react-intl@^5.18.1",
|
|
52
52
|
"uuid": "^3.1.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@atlaskit/editor-common": "^110.
|
|
55
|
+
"@atlaskit/editor-common": "^110.46.0",
|
|
56
56
|
"react": "^18.2.0",
|
|
57
57
|
"react-dom": "^18.2.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
|
-
"@testing-library/react": "^
|
|
60
|
+
"@testing-library/react": "^16.3.0",
|
|
61
61
|
"wait-for-expect": "^1.2.0"
|
|
62
62
|
},
|
|
63
63
|
"techstack": {
|
|
@@ -118,9 +118,6 @@
|
|
|
118
118
|
"platform_editor_link_paste_select_all": {
|
|
119
119
|
"type": "boolean"
|
|
120
120
|
},
|
|
121
|
-
"platform_editor_paste_code_fence_spaces": {
|
|
122
|
-
"type": "boolean"
|
|
123
|
-
},
|
|
124
121
|
"platform_editor_date_to_text": {
|
|
125
122
|
"type": "boolean"
|
|
126
123
|
}
|