@atlaskit/editor-wikimarkup-transformer 11.1.2 → 11.1.3

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/editor-wikimarkup-transformer
2
2
 
3
+ ## 11.1.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`916af279b4d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/916af279b4d) - added validation to handle strong mark under list
8
+
3
9
  ## 11.1.2
4
10
 
5
11
  ### Patch Changes
@@ -23,6 +23,8 @@ var _ = require("./");
23
23
 
24
24
  var _whitespace = require("./whitespace");
25
25
 
26
+ var _text2 = require("../utils/text");
27
+
26
28
  var MAX_LIST_DEPTH = 20;
27
29
  exports.MAX_LIST_DEPTH = MAX_LIST_DEPTH;
28
30
  var LIST_ITEM_REGEXP = new RegExp("^ *([*\\-#]{1,".concat(MAX_LIST_DEPTH, "}) "));
@@ -312,7 +314,11 @@ function sanitize(nodes, schema) {
312
314
  n.text = n.text.toUpperCase();
313
315
  }
314
316
 
315
- contentBuffer.push(n.mark([].concat((0, _toConsumableArray2.default)(n.marks), [mark])));
317
+ if (n.type.name === 'text' && !(0, _text2.hasAnyOfMarks)(n, ['strong', 'code'])) {
318
+ contentBuffer.push(n.mark([].concat((0, _toConsumableArray2.default)(n.marks), [mark])));
319
+ } else {
320
+ contentBuffer.push(n);
321
+ }
316
322
  } else {
317
323
  contentBuffer.push(n);
318
324
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-wikimarkup-transformer",
3
- "version": "11.1.2",
3
+ "version": "11.1.3",
4
4
  "sideEffects": false
5
5
  }
@@ -4,6 +4,7 @@ import { normalizePMNodes } from '../utils/normalize';
4
4
  import { parseMacroKeyword } from './keyword';
5
5
  import { TokenType, parseToken } from './';
6
6
  import { parseNewlineOnly } from './whitespace';
7
+ import { hasAnyOfMarks } from '../utils/text';
7
8
  export const MAX_LIST_DEPTH = 20;
8
9
  const LIST_ITEM_REGEXP = new RegExp(`^ *([*\\-#]{1,${MAX_LIST_DEPTH}}) `);
9
10
  const EMPTY_LINE_REGEXP = /^[ \t]*\r?\n/;
@@ -269,7 +270,11 @@ function sanitize(nodes, schema) {
269
270
  n.text = n.text.toUpperCase();
270
271
  }
271
272
 
272
- contentBuffer.push(n.mark([...n.marks, mark]));
273
+ if (n.type.name === 'text' && !hasAnyOfMarks(n, ['strong', 'code'])) {
274
+ contentBuffer.push(n.mark([...n.marks, mark]));
275
+ } else {
276
+ contentBuffer.push(n);
277
+ }
273
278
  } else {
274
279
  contentBuffer.push(n);
275
280
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-wikimarkup-transformer",
3
- "version": "11.1.2",
3
+ "version": "11.1.3",
4
4
  "sideEffects": false
5
5
  }
@@ -6,6 +6,7 @@ import { normalizePMNodes } from '../utils/normalize';
6
6
  import { parseMacroKeyword } from './keyword';
7
7
  import { TokenType, parseToken } from './';
8
8
  import { parseNewlineOnly } from './whitespace';
9
+ import { hasAnyOfMarks } from '../utils/text';
9
10
  export var MAX_LIST_DEPTH = 20;
10
11
  var LIST_ITEM_REGEXP = new RegExp("^ *([*\\-#]{1,".concat(MAX_LIST_DEPTH, "}) "));
11
12
  var EMPTY_LINE_REGEXP = /^[ \t]*\r?\n/;
@@ -291,7 +292,11 @@ function sanitize(nodes, schema) {
291
292
  n.text = n.text.toUpperCase();
292
293
  }
293
294
 
294
- contentBuffer.push(n.mark([].concat(_toConsumableArray(n.marks), [mark])));
295
+ if (n.type.name === 'text' && !hasAnyOfMarks(n, ['strong', 'code'])) {
296
+ contentBuffer.push(n.mark([].concat(_toConsumableArray(n.marks), [mark])));
297
+ } else {
298
+ contentBuffer.push(n);
299
+ }
295
300
  } else {
296
301
  contentBuffer.push(n);
297
302
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-wikimarkup-transformer",
3
- "version": "11.1.2",
3
+ "version": "11.1.3",
4
4
  "sideEffects": false
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-wikimarkup-transformer",
3
- "version": "11.1.2",
3
+ "version": "11.1.3",
4
4
  "description": "Wiki markup transformer for JIRA and Confluence",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -37,7 +37,7 @@
37
37
  "@atlaskit/editor-core": "^172.1.0",
38
38
  "@atlaskit/editor-test-helpers": "^17.1.0",
39
39
  "@atlaskit/mention": "^21.0.0",
40
- "@atlaskit/profilecard": "^16.12.0",
40
+ "@atlaskit/profilecard": "^17.0.0",
41
41
  "@atlaskit/renderer": "^101.1.0",
42
42
  "@atlaskit/util-data-test": "^17.5.0",
43
43
  "@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",