@atlaskit/editor-wikimarkup-transformer 11.12.6 → 11.13.0
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 +12 -0
- package/dist/cjs/encoder/index.js +3 -0
- package/dist/cjs/encoder/marks/__base.js +6 -0
- package/dist/cjs/encoder/nodes/media-inline.js +1 -2
- package/dist/cjs/encoder/nodes/text.js +13 -1
- package/dist/cjs/index.js +4 -2
- package/dist/cjs/parser/abstract-tree.js +1 -2
- package/dist/cjs/parser/builder/list-builder.js +8 -2
- package/dist/cjs/parser/builder/table-builder.js +5 -2
- package/dist/cjs/parser/error.js +3 -0
- package/dist/cjs/parser/nodes/mediaSingle.js +7 -0
- package/dist/cjs/parser/tokenize/blockquote.js +2 -0
- package/dist/cjs/parser/tokenize/code-macro.js +2 -0
- package/dist/cjs/parser/tokenize/common-formatter.js +9 -4
- package/dist/cjs/parser/tokenize/common-macro.js +4 -0
- package/dist/cjs/parser/tokenize/dash-token-creator.js +2 -0
- package/dist/cjs/parser/tokenize/emoji.js +4 -0
- package/dist/cjs/parser/tokenize/file-link.js +2 -0
- package/dist/cjs/parser/tokenize/force-line-break.js +2 -0
- package/dist/cjs/parser/tokenize/heading.js +2 -0
- package/dist/cjs/parser/tokenize/index.js +1 -1
- package/dist/cjs/parser/tokenize/issue-key.js +7 -0
- package/dist/cjs/parser/tokenize/keyword.js +30 -0
- package/dist/cjs/parser/tokenize/link-text.js +11 -2
- package/dist/cjs/parser/tokenize/links/link-format.js +2 -0
- package/dist/cjs/parser/tokenize/links/url-link.js +2 -0
- package/dist/cjs/parser/tokenize/list.js +7 -0
- package/dist/cjs/parser/tokenize/noformat-macro.js +2 -0
- package/dist/cjs/parser/tokenize/quadruple-dash-symbol.js +2 -0
- package/dist/cjs/parser/tokenize/ruler.js +2 -0
- package/dist/cjs/parser/tokenize/table.js +7 -0
- package/dist/cjs/parser/utils/panel-type.js +8 -0
- package/dist/cjs/parser/utils/text.js +3 -2
- package/dist/es2019/encoder/index.js +4 -0
- package/dist/es2019/encoder/marks/__base.js +6 -0
- package/dist/es2019/encoder/nodes/media-inline.js +1 -2
- package/dist/es2019/encoder/nodes/media.js +1 -1
- package/dist/es2019/encoder/nodes/text.js +13 -1
- package/dist/es2019/index.js +3 -0
- package/dist/es2019/parser/builder/list-builder.js +7 -0
- package/dist/es2019/parser/builder/table-builder.js +4 -0
- package/dist/es2019/parser/error.js +3 -0
- package/dist/es2019/parser/nodes/mediaSingle.js +7 -0
- package/dist/es2019/parser/tokenize/blockquote.js +2 -0
- package/dist/es2019/parser/tokenize/code-macro.js +2 -0
- package/dist/es2019/parser/tokenize/common-formatter.js +10 -5
- package/dist/es2019/parser/tokenize/common-macro.js +4 -0
- package/dist/es2019/parser/tokenize/dash-token-creator.js +2 -0
- package/dist/es2019/parser/tokenize/emoji.js +4 -0
- package/dist/es2019/parser/tokenize/file-link.js +2 -0
- package/dist/es2019/parser/tokenize/force-line-break.js +2 -0
- package/dist/es2019/parser/tokenize/heading.js +2 -0
- package/dist/es2019/parser/tokenize/issue-key.js +7 -0
- package/dist/es2019/parser/tokenize/keyword.js +30 -0
- package/dist/es2019/parser/tokenize/link-text.js +12 -3
- package/dist/es2019/parser/tokenize/links/link-format.js +2 -0
- package/dist/es2019/parser/tokenize/links/url-link.js +2 -0
- package/dist/es2019/parser/tokenize/list.js +7 -0
- package/dist/es2019/parser/tokenize/noformat-macro.js +2 -0
- package/dist/es2019/parser/tokenize/quadruple-dash-symbol.js +2 -0
- package/dist/es2019/parser/tokenize/ruler.js +2 -0
- package/dist/es2019/parser/tokenize/table.js +8 -2
- package/dist/es2019/parser/utils/escape.js +1 -1
- package/dist/es2019/parser/utils/panel-type.js +8 -0
- package/dist/es2019/parser/utils/text.js +2 -0
- package/dist/esm/encoder/index.js +4 -0
- package/dist/esm/encoder/marks/__base.js +6 -0
- package/dist/esm/encoder/nodes/media-inline.js +1 -2
- package/dist/esm/encoder/nodes/text.js +13 -1
- package/dist/esm/index.js +4 -2
- package/dist/esm/parser/abstract-tree.js +1 -2
- package/dist/esm/parser/builder/list-builder.js +8 -2
- package/dist/esm/parser/builder/table-builder.js +5 -2
- package/dist/esm/parser/error.js +3 -0
- package/dist/esm/parser/nodes/mediaSingle.js +7 -0
- package/dist/esm/parser/tokenize/blockquote.js +2 -0
- package/dist/esm/parser/tokenize/code-macro.js +2 -0
- package/dist/esm/parser/tokenize/common-formatter.js +9 -4
- package/dist/esm/parser/tokenize/common-macro.js +4 -0
- package/dist/esm/parser/tokenize/dash-token-creator.js +2 -0
- package/dist/esm/parser/tokenize/emoji.js +4 -0
- package/dist/esm/parser/tokenize/file-link.js +2 -0
- package/dist/esm/parser/tokenize/force-line-break.js +2 -0
- package/dist/esm/parser/tokenize/heading.js +2 -0
- package/dist/esm/parser/tokenize/index.js +1 -1
- package/dist/esm/parser/tokenize/issue-key.js +7 -0
- package/dist/esm/parser/tokenize/keyword.js +30 -0
- package/dist/esm/parser/tokenize/link-text.js +11 -2
- package/dist/esm/parser/tokenize/links/link-format.js +2 -0
- package/dist/esm/parser/tokenize/links/url-link.js +2 -0
- package/dist/esm/parser/tokenize/list.js +7 -0
- package/dist/esm/parser/tokenize/noformat-macro.js +2 -0
- package/dist/esm/parser/tokenize/quadruple-dash-symbol.js +2 -0
- package/dist/esm/parser/tokenize/ruler.js +2 -0
- package/dist/esm/parser/tokenize/table.js +8 -2
- package/dist/esm/parser/utils/panel-type.js +8 -0
- package/dist/esm/parser/utils/text.js +3 -2
- package/docs/0-intro.tsx +4 -0
- package/package.json +10 -10
- package/tsconfig.json +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-wikimarkup-transformer
|
|
2
2
|
|
|
3
|
+
## 11.13.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#109060](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109060)
|
|
8
|
+
[`4660ec858a305`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4660ec858a305) -
|
|
9
|
+
Update `React` from v16 to v18
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 11.12.6
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -23,6 +23,9 @@ var _unknown = require("./nodes/unknown");
|
|
|
23
23
|
var _blockCard = require("./nodes/block-card");
|
|
24
24
|
var _embedCard = require("./nodes/embed-card");
|
|
25
25
|
var _caption = require("./nodes/caption");
|
|
26
|
+
// Ignored via go/ees005
|
|
27
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
28
|
+
|
|
26
29
|
var nodeEncoderMapping = {
|
|
27
30
|
blockquote: _blockquote.blockquote,
|
|
28
31
|
bulletList: _bulletList.bulletList,
|
|
@@ -9,6 +9,8 @@ exports.baseMarkPattern = void 0;
|
|
|
9
9
|
* convert it to `* strong *. Instead, we need it to be ` *strong* `
|
|
10
10
|
*/
|
|
11
11
|
var baseMarkPattern = exports.baseMarkPattern = function baseMarkPattern(text, token) {
|
|
12
|
+
// Ignored via go/ees005
|
|
13
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
12
14
|
if (/^\s*$/.test(text)) {
|
|
13
15
|
/**
|
|
14
16
|
* If it's a string with only whitespaces, wiki renderer
|
|
@@ -16,5 +18,9 @@ var baseMarkPattern = exports.baseMarkPattern = function baseMarkPattern(text, t
|
|
|
16
18
|
*/
|
|
17
19
|
return text;
|
|
18
20
|
}
|
|
21
|
+
// Ignored via go/ees005
|
|
22
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
23
|
+
// Ignored via go/ees005
|
|
24
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
19
25
|
return text.replace(/^\s*/, "$&".concat(token)).replace(/\s*$/, "".concat(token, "$&"));
|
|
20
26
|
};
|
|
@@ -8,7 +8,6 @@ var mediaInline = exports.mediaInline = function mediaInline(node) {
|
|
|
8
8
|
var _context$conversion$m, _context$conversion;
|
|
9
9
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
10
10
|
context = _ref.context;
|
|
11
|
-
var fileName;
|
|
12
|
-
fileName = (_context$conversion$m = context === null || context === void 0 || (_context$conversion = context.conversion) === null || _context$conversion === void 0 || (_context$conversion = _context$conversion.mediaConversion) === null || _context$conversion === void 0 || (_context$conversion = _context$conversion[node.attrs.id]) === null || _context$conversion === void 0 ? void 0 : _context$conversion.transform) !== null && _context$conversion$m !== void 0 ? _context$conversion$m : node.attrs.id;
|
|
11
|
+
var fileName = (_context$conversion$m = context === null || context === void 0 || (_context$conversion = context.conversion) === null || _context$conversion === void 0 || (_context$conversion = _context$conversion.mediaConversion) === null || _context$conversion === void 0 || (_context$conversion = _context$conversion[node.attrs.id]) === null || _context$conversion === void 0 ? void 0 : _context$conversion.transform) !== null && _context$conversion$m !== void 0 ? _context$conversion$m : node.attrs.id;
|
|
13
12
|
return "[^".concat(fileName, "]");
|
|
14
13
|
};
|
|
@@ -54,12 +54,24 @@ function escapingWikiFormatter(text) {
|
|
|
54
54
|
var pattern = [MENTION_ESCAPE_PATTERN].concat((0, _toConsumableArray2.default)(_keyword.macroKeywordTokenMap.map(function (macro) {
|
|
55
55
|
return "(".concat(macro.regex.source.replace('^', ''), ")");
|
|
56
56
|
}))).join('|');
|
|
57
|
-
return text
|
|
57
|
+
return text
|
|
58
|
+
// Ignored via go/ees005
|
|
59
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
60
|
+
.replace(new RegExp(pattern, 'g'), '\\$&')
|
|
61
|
+
// Ignored via go/ees005
|
|
62
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
63
|
+
.replace(new RegExp(MEDIA_ESCAPE_PATTERN, 'g'), '\\$1\\$2') // Extra step required for media as currently both ends need to be escaped e.q. !filename.txt!
|
|
64
|
+
// Ignored via go/ees005
|
|
65
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
58
66
|
.replace(new RegExp(MEDIA_GROUP_ESCAPE_PATTERN, 'g'), '\\$1\\$2');
|
|
59
67
|
}
|
|
60
68
|
var text = exports.text = function text(node) {
|
|
61
69
|
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
|
62
70
|
parent = _ref.parent;
|
|
71
|
+
// Ignored via go/ees005
|
|
72
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
73
|
+
// Ignored via go/ees005
|
|
74
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
63
75
|
var result = isEscapeNeeded(node, parent) ? escapingWikiFormatter(node.text) : node.text;
|
|
64
76
|
markEncoderMapping.forEach(function (encoder, markName) {
|
|
65
77
|
var mark = node.marks.find(function (m) {
|
package/dist/cjs/index.js
CHANGED
|
@@ -23,9 +23,11 @@ var WikiMarkupTransformer = exports.WikiMarkupTransformer = /*#__PURE__*/functio
|
|
|
23
23
|
|
|
24
24
|
// [ADFS-725] Jira breaks if there are null chars it is easier to remove them here
|
|
25
25
|
// The following has to be a regex to remove all instances of null instead of the first
|
|
26
|
-
(0, _createClass2.default)(WikiMarkupTransformer, [{
|
|
26
|
+
return (0, _createClass2.default)(WikiMarkupTransformer, [{
|
|
27
27
|
key: "sanitizeWikiMarkup",
|
|
28
28
|
value: function sanitizeWikiMarkup(wikiMarkup) {
|
|
29
|
+
// Ignored via go/ees005
|
|
30
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
29
31
|
return wikiMarkup.replace(/\0/g, '');
|
|
30
32
|
}
|
|
31
33
|
}, {
|
|
@@ -53,7 +55,6 @@ var WikiMarkupTransformer = exports.WikiMarkupTransformer = /*#__PURE__*/functio
|
|
|
53
55
|
}) : {};
|
|
54
56
|
}
|
|
55
57
|
}]);
|
|
56
|
-
return WikiMarkupTransformer;
|
|
57
58
|
}();
|
|
58
59
|
/**
|
|
59
60
|
* Turns mentionConversion object keys to lowercase for case insensitivity matching
|
|
@@ -65,6 +66,7 @@ var normalizeContextObject = function normalizeContextObject(context) {
|
|
|
65
66
|
return context;
|
|
66
67
|
}
|
|
67
68
|
var mentionConversion = {};
|
|
69
|
+
// eslint-disable-next-line guard-for-in
|
|
68
70
|
for (var key in context.conversion.mentionConversion) {
|
|
69
71
|
mentionConversion[key.toLowerCase()] = context.conversion.mentionConversion[key];
|
|
70
72
|
}
|
|
@@ -19,7 +19,7 @@ var AbstractTree = exports.default = /*#__PURE__*/function () {
|
|
|
19
19
|
/**
|
|
20
20
|
* Convert reduced macros tree into prosemirror model tree
|
|
21
21
|
*/
|
|
22
|
-
(0, _createClass2.default)(AbstractTree, [{
|
|
22
|
+
return (0, _createClass2.default)(AbstractTree, [{
|
|
23
23
|
key: "getProseMirrorModel",
|
|
24
24
|
value: function getProseMirrorModel(context) {
|
|
25
25
|
var content = (0, _text.parseString)({
|
|
@@ -31,5 +31,4 @@ var AbstractTree = exports.default = /*#__PURE__*/function () {
|
|
|
31
31
|
return this.schema.nodes.doc.createChecked({}, (0, _normalize.normalizePMNodes)(content, this.schema, 'doc'));
|
|
32
32
|
}
|
|
33
33
|
}]);
|
|
34
|
-
return AbstractTree;
|
|
35
34
|
}();
|
|
@@ -19,6 +19,8 @@ var supportedContentType = ['paragraph', 'orderedList', 'bulletList', 'mediaSing
|
|
|
19
19
|
* Return the type of a list from the bullets
|
|
20
20
|
*/
|
|
21
21
|
function getType(bullets) {
|
|
22
|
+
// Ignored via go/ees005
|
|
23
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
22
24
|
return /#$/.test(bullets) ? 'orderedList' : 'bulletList';
|
|
23
25
|
}
|
|
24
26
|
var ListBuilder = exports.ListBuilder = /*#__PURE__*/function () {
|
|
@@ -124,7 +126,7 @@ var ListBuilder = exports.ListBuilder = /*#__PURE__*/function () {
|
|
|
124
126
|
* Return the type of the base list
|
|
125
127
|
* @returns {ListType}
|
|
126
128
|
*/
|
|
127
|
-
(0, _createClass2.default)(ListBuilder, [{
|
|
129
|
+
return (0, _createClass2.default)(ListBuilder, [{
|
|
128
130
|
key: "type",
|
|
129
131
|
get: function get() {
|
|
130
132
|
return this.root.type;
|
|
@@ -233,6 +235,8 @@ var ListBuilder = exports.ListBuilder = /*#__PURE__*/function () {
|
|
|
233
235
|
type: type,
|
|
234
236
|
parent: parent
|
|
235
237
|
};
|
|
238
|
+
// Ignored via go/ees005
|
|
239
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
236
240
|
parent.children.push(newList);
|
|
237
241
|
this.lastList = list = newList;
|
|
238
242
|
}
|
|
@@ -255,6 +259,9 @@ var ListBuilder = exports.ListBuilder = /*#__PURE__*/function () {
|
|
|
255
259
|
var _ref;
|
|
256
260
|
var children = this.lastList.children;
|
|
257
261
|
var lastItem = children[children.length - 1];
|
|
262
|
+
|
|
263
|
+
// Ignored via go/ees005
|
|
264
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
258
265
|
(_ref = lastItem.content).push.apply(_ref, (0, _toConsumableArray2.default)(content));
|
|
259
266
|
}
|
|
260
267
|
|
|
@@ -301,5 +308,4 @@ var ListBuilder = exports.ListBuilder = /*#__PURE__*/function () {
|
|
|
301
308
|
return list;
|
|
302
309
|
}
|
|
303
310
|
}]);
|
|
304
|
-
return ListBuilder;
|
|
305
311
|
}();
|
|
@@ -15,6 +15,8 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
|
|
|
15
15
|
* Return the cell type based on the delimeter
|
|
16
16
|
*/
|
|
17
17
|
function getType(style) {
|
|
18
|
+
// Ignored via go/ees005
|
|
19
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
18
20
|
return /\|\|/.test(style) ? 'tableHeader' : 'tableCell';
|
|
19
21
|
}
|
|
20
22
|
var TableBuilder = exports.TableBuilder = /*#__PURE__*/function () {
|
|
@@ -76,7 +78,7 @@ var TableBuilder = exports.TableBuilder = /*#__PURE__*/function () {
|
|
|
76
78
|
* Return the type of the base element
|
|
77
79
|
* @returns {string}
|
|
78
80
|
*/
|
|
79
|
-
(0, _createClass2.default)(TableBuilder, [{
|
|
81
|
+
return (0, _createClass2.default)(TableBuilder, [{
|
|
80
82
|
key: "type",
|
|
81
83
|
get: function get() {
|
|
82
84
|
return 'table';
|
|
@@ -111,6 +113,8 @@ var TableBuilder = exports.TableBuilder = /*#__PURE__*/function () {
|
|
|
111
113
|
type: cellType,
|
|
112
114
|
content: content
|
|
113
115
|
};
|
|
116
|
+
// Ignored via go/ees005
|
|
117
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
114
118
|
this.lastRow.cells.push(newCell);
|
|
115
119
|
index += 1;
|
|
116
120
|
}
|
|
@@ -145,5 +149,4 @@ var TableBuilder = exports.TableBuilder = /*#__PURE__*/function () {
|
|
|
145
149
|
this.lastRow = row;
|
|
146
150
|
}
|
|
147
151
|
}]);
|
|
148
|
-
return TableBuilder;
|
|
149
152
|
}();
|
package/dist/cjs/parser/error.js
CHANGED
|
@@ -11,6 +11,9 @@ function error(message, _input, line, column) {
|
|
|
11
11
|
column: column
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
+
|
|
15
|
+
// Ignored via go/ees005
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
17
|
function createError(props) {
|
|
15
18
|
var err = Object.create(SyntaxError.prototype);
|
|
16
19
|
Object.assign(err, props, {
|
|
@@ -37,6 +37,9 @@ function getMediaSingleNodeView(schema, filename, attrs) {
|
|
|
37
37
|
var _context$defaults$med2, _context$defaults4;
|
|
38
38
|
mediaNodeAttrs.height = (_context$defaults$med2 = context === null || context === void 0 || (_context$defaults4 = context.defaults) === null || _context$defaults4 === void 0 || (_context$defaults4 = _context$defaults4.media) === null || _context$defaults4 === void 0 ? void 0 : _context$defaults4.height) !== null && _context$defaults$med2 !== void 0 ? _context$defaults$med2 : defaultHeight;
|
|
39
39
|
}
|
|
40
|
+
|
|
41
|
+
// Ignored via go/ees005
|
|
42
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
43
|
var mediaSingleAttrs = {
|
|
41
44
|
layout: 'center'
|
|
42
45
|
};
|
|
@@ -61,6 +64,8 @@ function getMediaSingleNodeView(schema, filename, attrs) {
|
|
|
61
64
|
}
|
|
62
65
|
}
|
|
63
66
|
if (attrs.href) {
|
|
67
|
+
// Ignored via go/ees005
|
|
68
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
64
69
|
var href = attrs.href.replace(/^"(.+)"$/, '$1');
|
|
65
70
|
mediaMarks.push(link.create({
|
|
66
71
|
href: href
|
|
@@ -68,6 +73,8 @@ function getMediaSingleNodeView(schema, filename, attrs) {
|
|
|
68
73
|
}
|
|
69
74
|
if (attrs.alt) {
|
|
70
75
|
// strip wrapping quotes if they exist
|
|
76
|
+
// Ignored via go/ees005
|
|
77
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
71
78
|
var altText = attrs.alt.replace(/^"(.+)"$/, '$1');
|
|
72
79
|
mediaNodeAttrs.alt = altText;
|
|
73
80
|
}
|
|
@@ -8,6 +8,8 @@ exports.blockquote = void 0;
|
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _quoteMacro = require("./quote-macro");
|
|
10
10
|
// bq. foobarbaz
|
|
11
|
+
// Ignored via go/ees005
|
|
12
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
11
13
|
var BLOCKQUOTE_REGEXP = /^bq\.(.*)/;
|
|
12
14
|
var blockquote = exports.blockquote = function blockquote(_ref) {
|
|
13
15
|
var input = _ref.input,
|
|
@@ -28,6 +28,8 @@ var rawContentProcessor = function rawContentProcessor(rawAttrs, rawContent, len
|
|
|
28
28
|
var output = [];
|
|
29
29
|
var codeBlock = schema.nodes.codeBlock;
|
|
30
30
|
var parsedAttrs = (0, _attrs.parseAttrs)(rawAttrs);
|
|
31
|
+
// Ignored via go/ees005
|
|
32
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
31
33
|
var trimedContent = rawContent.replace(/^\s+|\s+$/g, '');
|
|
32
34
|
var textNode = trimedContent.length ? schema.text(trimedContent) : undefined;
|
|
33
35
|
if (parsedAttrs.title) {
|
|
@@ -8,7 +8,6 @@ var _ = require("./");
|
|
|
8
8
|
var _linkFormat = require("./links/link-format");
|
|
9
9
|
var _whitespace = require("./whitespace");
|
|
10
10
|
var _keyword = require("./keyword");
|
|
11
|
-
var _2 = require(".");
|
|
12
11
|
var _escape = require("../utils/escape");
|
|
13
12
|
var processState = {
|
|
14
13
|
START: 0,
|
|
@@ -39,7 +38,10 @@ function commonFormatter(input, position, schema, opt) {
|
|
|
39
38
|
* formatter
|
|
40
39
|
*/
|
|
41
40
|
var charBeforeOpening = input.charAt(position - 1);
|
|
42
|
-
if (!openingWrapped &&
|
|
41
|
+
if (!openingWrapped &&
|
|
42
|
+
// Ignored via go/ees005
|
|
43
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
44
|
+
/[a-zA-Z0-9]|[^\u0000-\u007F]/.test(charBeforeOpening) && charBeforeOpening !== "\xA0") {
|
|
43
45
|
return fallback(input, index, openingSymbolLength);
|
|
44
46
|
}
|
|
45
47
|
}
|
|
@@ -98,7 +100,10 @@ function commonFormatter(input, position, schema, opt) {
|
|
|
98
100
|
*/
|
|
99
101
|
if (index < input.length) {
|
|
100
102
|
var charAfterEnd = input.charAt(index);
|
|
101
|
-
if (!closingWrapped &&
|
|
103
|
+
if (!closingWrapped &&
|
|
104
|
+
// Ignored via go/ees005
|
|
105
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
106
|
+
/[a-zA-Z0-9]|[^\u0000-\u007F]/.test(charAfterEnd) && charAfterEnd !== "\xA0") {
|
|
102
107
|
buffer.push(charsMatchClosingSymbol);
|
|
103
108
|
state = processState.BUFFER;
|
|
104
109
|
continue;
|
|
@@ -126,7 +131,7 @@ function commonFormatter(input, position, schema, opt) {
|
|
|
126
131
|
* Is not a problem send an empty context because we're only checking
|
|
127
132
|
* if it has a nested macro inside.
|
|
128
133
|
*/
|
|
129
|
-
var token = (0,
|
|
134
|
+
var token = (0, _.parseToken)(input, match.type, index, schema, {});
|
|
130
135
|
if (token.type === 'text') {
|
|
131
136
|
buffer.push(token.text);
|
|
132
137
|
index += token.length;
|
|
@@ -13,6 +13,8 @@ function commonMacro(input, schema, opt) {
|
|
|
13
13
|
* Forging the opening regex, the result would look something like
|
|
14
14
|
* /^\{(quote)(?::([^\{\n\}]*))?\}/i
|
|
15
15
|
*/
|
|
16
|
+
// Ignored via go/ees005
|
|
17
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
16
18
|
var opening = new RegExp("^{(".concat(opt.keyword, ")(?::([^{\n}]*))?}"), 'i');
|
|
17
19
|
var matchOpening = input.match(opening);
|
|
18
20
|
if (!matchOpening) {
|
|
@@ -34,6 +36,8 @@ function commonMacro(input, schema, opt) {
|
|
|
34
36
|
* Forging the closing regex, the result would look something like
|
|
35
37
|
* /\{quote\}/
|
|
36
38
|
*/
|
|
39
|
+
// Ignored via go/ees005
|
|
40
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
37
41
|
var closing = new RegExp("{".concat(name, "}"));
|
|
38
42
|
var matchClosing = closing.exec(input.substring(openingLength));
|
|
39
43
|
var rawContent = '';
|
|
@@ -4,6 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.wikiToAdfEmojiMapping = exports.emoji = exports.adfEmojiItems = void 0;
|
|
7
|
+
// Ignored via go/ees005
|
|
8
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
9
|
+
// Ignored via go/ees005
|
|
10
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
7
11
|
var emptyOrSpecialCharRegex = new RegExp(/^$|[^A-Za-z0-9]/);
|
|
8
12
|
var emoji = exports.emoji = function emoji(_ref) {
|
|
9
13
|
var input = _ref.input,
|
|
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.fileLink = fileLink;
|
|
8
8
|
var _mediaGroup = _interopRequireDefault(require("../nodes/mediaGroup"));
|
|
9
9
|
// [^attachment.pdf]
|
|
10
|
+
// Ignored via go/ees005
|
|
11
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
10
12
|
var FILE_LINK_REGEXP = /^\[\^([\(\)\w. -]+)\]/;
|
|
11
13
|
function fileLink(input, position, schema) {
|
|
12
14
|
var match = input.substring(position).match(FILE_LINK_REGEXP);
|
|
@@ -9,6 +9,8 @@ exports.forceLineBreak = void 0;
|
|
|
9
9
|
* private static final Pattern FORCE_NEWLINE = Pattern.compile("(?<!\\\\)\\\\{2}(?!\\S*\\\\)");
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
+
// Ignored via go/ees005
|
|
13
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
12
14
|
var FORCE_LINE_BREAK_REGEX = /^\\{2}(?!\S*\\)/;
|
|
13
15
|
var forceLineBreak = exports.forceLineBreak = function forceLineBreak(_ref) {
|
|
14
16
|
var input = _ref.input,
|
|
@@ -7,6 +7,8 @@ exports.heading = void 0;
|
|
|
7
7
|
var _text = require("../text");
|
|
8
8
|
var _ = require("./");
|
|
9
9
|
// h1. HEADING
|
|
10
|
+
// Ignored via go/ees005
|
|
11
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
10
12
|
var HEADING_REGEXP = /^h([1-6])\.(.*)/;
|
|
11
13
|
var heading = exports.heading = function heading(_ref) {
|
|
12
14
|
var input = _ref.input,
|
|
@@ -73,7 +73,7 @@ var TokenType = exports.TokenType = /*#__PURE__*/function (TokenType) {
|
|
|
73
73
|
TokenType["FORCE_LINE_BREAK"] = "FORCE_LINE_BREAK";
|
|
74
74
|
return TokenType;
|
|
75
75
|
}({}); // \\
|
|
76
|
-
var tokenToTokenParserMapping = (_tokenToTokenParserMa = {}, (0, _defineProperty2.default)(
|
|
76
|
+
var tokenToTokenParserMapping = (_tokenToTokenParserMa = {}, (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_tokenToTokenParserMa, TokenType.DOUBLE_DASH_SYMBOL, _doubleDashSymbol.doubleDashSymbol), TokenType.TRIPLE_DASH_SYMBOL, _tripleDashSymbol.tripleDashSymbol), TokenType.QUADRUPLE_DASH_SYMBOL, _quadrupleDashSymbol.quadrupleDashSymbol), TokenType.RULER, _ruler.ruler), TokenType.STRONG, _strong.strong), TokenType.MONOSPACE, _monospace.monospace), TokenType.SUPERSCRIPT, _superscript.superscript), TokenType.SUBSCRIPT, _subscript.subscript), TokenType.EMPHASIS, _emphasis.emphasis), TokenType.CITATION, _citation.citation), (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_tokenToTokenParserMa, TokenType.DELETED, _deleted.deleted), TokenType.INSERTED, _inserted.inserted), TokenType.HARD_BREAK, _hardbreak.hardbreak), TokenType.LINK_FORMAT, _linkFormat.linkFormat), TokenType.LINK_TEXT, _linkText.linkText), TokenType.HEADING, _heading.heading), TokenType.MEDIA, _media.media), TokenType.LIST, _list.list), TokenType.QUOTE, _blockquote.blockquote), TokenType.TABLE, _table.table), (0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)((0, _defineProperty2.default)(_tokenToTokenParserMa, TokenType.EMOJI, _emoji.emoji), TokenType.ADF_MACRO, _adfMacro.adfMacro), TokenType.ANCHOR_MACRO, _anchorMacro.anchorMacro), TokenType.CODE_MACRO, _codeMacro.codeMacro), TokenType.QUOTE_MACRO, _quoteMacro.quoteMacro), TokenType.NOFORMAT_MACRO, _noformatMacro.noformatMacro), TokenType.PANEL_MACRO, _panelMacro.panelMacro), TokenType.COLOR_MACRO, _colorMacro.colorMacro), TokenType.FORCE_LINE_BREAK, _forceLineBreak.forceLineBreak), TokenType.ISSUE_KEY, _issueKey.issueKey));
|
|
77
77
|
function parseToken(input, type, position, schema, context) {
|
|
78
78
|
var tokenParser = tokenToTokenParserMapping[type];
|
|
79
79
|
if (tokenParser) {
|
|
@@ -13,6 +13,8 @@ var _text = require("../utils/text");
|
|
|
13
13
|
* [XX-999] from the ones which should be blue links in the ADF to WikiMarkup
|
|
14
14
|
* convertion.
|
|
15
15
|
*/
|
|
16
|
+
// Ignored via go/ees005
|
|
17
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
16
18
|
var INLINE_CARD_FROM_TEXT_STAMP = exports.INLINE_CARD_FROM_TEXT_STAMP = /(#icft=)([A-Z][A-Z]+-[0-9]+)/;
|
|
17
19
|
var issueKey = exports.issueKey = function issueKey(_ref) {
|
|
18
20
|
var input = _ref.input,
|
|
@@ -65,6 +67,9 @@ var buildInlineCard = exports.buildInlineCard = function buildInlineCard(schema,
|
|
|
65
67
|
var withInlineCardFromTextStamp = function withInlineCardFromTextStamp(issue) {
|
|
66
68
|
return INLINE_CARD_FROM_TEXT_STAMP.test(issue.url) ? issue.url : "".concat(issue.url, "#icft=").concat(issue.key);
|
|
67
69
|
};
|
|
70
|
+
|
|
71
|
+
// Ignored via go/ees005
|
|
72
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
68
73
|
var isNotAllowedChars = function isNotAllowedChars(char) {
|
|
69
74
|
return !/\s|\(|\)|!|\.|\,|\/|\:/.test(char);
|
|
70
75
|
};
|
|
@@ -76,5 +81,7 @@ var buildIssueKeyRegex = exports.buildIssueKeyRegex = function buildIssueKeyRege
|
|
|
76
81
|
if (!pattern) {
|
|
77
82
|
return undefined;
|
|
78
83
|
}
|
|
84
|
+
// Ignored via go/ees005
|
|
85
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
79
86
|
return new RegExp("^(".concat(pattern, ")"));
|
|
80
87
|
};
|
|
@@ -12,27 +12,43 @@ var _ = require("./");
|
|
|
12
12
|
var _list = require("./list");
|
|
13
13
|
var macroKeywordTokenMap = exports.macroKeywordTokenMap = [{
|
|
14
14
|
type: _.TokenType.ADF_MACRO,
|
|
15
|
+
// Ignored via go/ees005
|
|
16
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
15
17
|
regex: /^{adf/i
|
|
16
18
|
}, {
|
|
17
19
|
type: _.TokenType.ANCHOR_MACRO,
|
|
20
|
+
// Ignored via go/ees005
|
|
21
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
18
22
|
regex: /^{anchor/i
|
|
19
23
|
}, {
|
|
20
24
|
type: _.TokenType.CODE_MACRO,
|
|
25
|
+
// Ignored via go/ees005
|
|
26
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
21
27
|
regex: /^{code/i
|
|
22
28
|
}, {
|
|
23
29
|
type: _.TokenType.QUOTE_MACRO,
|
|
30
|
+
// Ignored via go/ees005
|
|
31
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
24
32
|
regex: /^{quote/i
|
|
25
33
|
}, {
|
|
26
34
|
type: _.TokenType.NOFORMAT_MACRO,
|
|
35
|
+
// Ignored via go/ees005
|
|
36
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
27
37
|
regex: /^{noformat/i
|
|
28
38
|
}, {
|
|
29
39
|
type: _.TokenType.PANEL_MACRO,
|
|
40
|
+
// Ignored via go/ees005
|
|
41
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
30
42
|
regex: /^{panel/i
|
|
31
43
|
}, {
|
|
32
44
|
type: _.TokenType.COLOR_MACRO,
|
|
45
|
+
// Ignored via go/ees005
|
|
46
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
33
47
|
regex: /^{color/
|
|
34
48
|
}, {
|
|
35
49
|
type: _.TokenType.LOREM_MACRO,
|
|
50
|
+
// Ignored via go/ees005
|
|
51
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
36
52
|
regex: /^{loremipsum/i
|
|
37
53
|
}];
|
|
38
54
|
|
|
@@ -112,25 +128,39 @@ function parseOtherKeyword(input) {
|
|
|
112
128
|
*/
|
|
113
129
|
var leadingKeywordTokenMap = [{
|
|
114
130
|
type: _.TokenType.QUOTE,
|
|
131
|
+
// Ignored via go/ees005
|
|
132
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
115
133
|
regex: /^bq\./
|
|
116
134
|
}, {
|
|
117
135
|
type: _.TokenType.HEADING,
|
|
136
|
+
// Ignored via go/ees005
|
|
137
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
118
138
|
regex: /^h[1-6]\./
|
|
119
139
|
}, {
|
|
120
140
|
type: _.TokenType.RULER,
|
|
141
|
+
// Ignored via go/ees005
|
|
142
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
121
143
|
regex: /^-{4,5}(\s|$)/
|
|
122
144
|
}, {
|
|
123
145
|
type: _.TokenType.TRIPLE_DASH_SYMBOL,
|
|
146
|
+
// Ignored via go/ees005
|
|
147
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
124
148
|
regex: /^-{3}\s/
|
|
125
149
|
}, {
|
|
126
150
|
type: _.TokenType.DOUBLE_DASH_SYMBOL,
|
|
151
|
+
// Ignored via go/ees005
|
|
152
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
127
153
|
regex: /^-{2}\s/
|
|
128
154
|
}, {
|
|
129
155
|
// Lists are limited to max 20 levels of depth
|
|
130
156
|
type: _.TokenType.LIST,
|
|
157
|
+
// Ignored via go/ees005
|
|
158
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
131
159
|
regex: new RegExp("^([*#]{1,".concat(_list.MAX_LIST_DEPTH, "}|-) "))
|
|
132
160
|
}, {
|
|
133
161
|
type: _.TokenType.TABLE,
|
|
162
|
+
// Ignored via go/ees005
|
|
163
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
134
164
|
regex: /^\|{1,2}/
|
|
135
165
|
}];
|
|
136
166
|
function parseLeadingKeyword(input) {
|
|
@@ -7,7 +7,10 @@ exports.linkText = exports.LINK_TEXT_REGEXP = void 0;
|
|
|
7
7
|
var _adfSchema = require("@atlaskit/adf-schema");
|
|
8
8
|
var _url = require("../utils/url");
|
|
9
9
|
// the regex should exclude the period and exclamation mark as the last character
|
|
10
|
-
var LINK_TEXT_REGEXP = exports.LINK_TEXT_REGEXP =
|
|
10
|
+
var LINK_TEXT_REGEXP = exports.LINK_TEXT_REGEXP =
|
|
11
|
+
// Ignored via go/ees005
|
|
12
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
13
|
+
/^((?:(?:https?|ftps?):\/\/)|irc:\/\/|mailto:)([\w?!~^\/\\#$%&'()*+,\-.\/:;<=@]*[\w~^\/\\#$%&'()*+,\-\/:;<=@])/i;
|
|
11
14
|
var linkText = exports.linkText = function linkText(_ref) {
|
|
12
15
|
var input = _ref.input,
|
|
13
16
|
position = _ref.position,
|
|
@@ -62,5 +65,11 @@ function fallback(input, position) {
|
|
|
62
65
|
|
|
63
66
|
// removes bad characters from the end of regex match
|
|
64
67
|
function trimBadEndChar(input) {
|
|
65
|
-
return [
|
|
68
|
+
return [
|
|
69
|
+
// Ignored via go/ees005
|
|
70
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
71
|
+
input[0].replace(/[.,>)\];}"\'!]*$/, ''), input[1],
|
|
72
|
+
// Ignored via go/ees005
|
|
73
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
74
|
+
input[2].replace(/[.,>)\];}"\'!]*$/, '')];
|
|
66
75
|
}
|
|
@@ -9,6 +9,8 @@ var _text = require("../../text");
|
|
|
9
9
|
var _linkResolver = require("./link-resolver");
|
|
10
10
|
var _linkParser = require("./link-parser");
|
|
11
11
|
// [http://www.example.com] and [Example|http://www.example.com]
|
|
12
|
+
// Ignored via go/ees005
|
|
13
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
12
14
|
var LINK_FORMAT_REGEXP = /^\[([^\[\]\n]+)]/;
|
|
13
15
|
var linkFormat = exports.linkFormat = function linkFormat(_ref) {
|
|
14
16
|
var input = _ref.input,
|
|
@@ -22,6 +22,8 @@ function urlLinkResolver(link, schema, context) {
|
|
|
22
22
|
ignoreTokenTypes: ignoreTokenTypes,
|
|
23
23
|
schema: schema,
|
|
24
24
|
context: context,
|
|
25
|
+
// Ignored via go/ees005
|
|
26
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
25
27
|
input: textRepresentation.replace(/^mailto:/, '')
|
|
26
28
|
});
|
|
27
29
|
var decoratedContent = rawContent.map(function (n) {
|
|
@@ -15,8 +15,15 @@ var _ = require("./");
|
|
|
15
15
|
var _whitespace = require("./whitespace");
|
|
16
16
|
var _text2 = require("../utils/text");
|
|
17
17
|
var MAX_LIST_DEPTH = exports.MAX_LIST_DEPTH = 20;
|
|
18
|
+
|
|
19
|
+
// Ignored via go/ees005
|
|
20
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
18
21
|
var LIST_ITEM_REGEXP = new RegExp("^ *([*\\-#]{1,".concat(MAX_LIST_DEPTH, "}) "));
|
|
22
|
+
// Ignored via go/ees005
|
|
23
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
19
24
|
var EMPTY_LINE_REGEXP = /^[ \t]*\r?\n/;
|
|
25
|
+
// Ignored via go/ees005
|
|
26
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
20
27
|
var RULER_SYMBOL_REGEXP = /^-{4,5}/;
|
|
21
28
|
var processState = {
|
|
22
29
|
NEW_LINE: 0,
|
|
@@ -23,6 +23,8 @@ var rawContentProcessor = function rawContentProcessor(rawAttrs, rawContent, len
|
|
|
23
23
|
var output = [];
|
|
24
24
|
var codeBlock = schema.nodes.codeBlock;
|
|
25
25
|
var parsedAttrs = (0, _attrs.parseAttrs)(rawAttrs);
|
|
26
|
+
// Ignored via go/ees005
|
|
27
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
26
28
|
var trimedContent = rawContent.replace(/^\s+|\s+$/g, '');
|
|
27
29
|
var textNode = trimedContent.length ? schema.text(trimedContent) : undefined;
|
|
28
30
|
if (parsedAttrs.title) {
|
|
@@ -4,6 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.quadrupleDashSymbol = void 0;
|
|
7
|
+
// Ignored via go/ees005
|
|
8
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
7
9
|
var MULTI_DASH_REGEX = /^-{4,}(\s|$)/;
|
|
8
10
|
var quadrupleDashSymbol = exports.quadrupleDashSymbol = function quadrupleDashSymbol(_ref) {
|
|
9
11
|
var input = _ref.input,
|
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.ruler = void 0;
|
|
7
7
|
var _rule = require("../nodes/rule");
|
|
8
|
+
// Ignored via go/ees005
|
|
9
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
8
10
|
var RULER_REGEX = /^-{4,5}(\s|$)/;
|
|
9
11
|
var ruler = exports.ruler = function ruler(_ref) {
|
|
10
12
|
var input = _ref.input,
|
|
@@ -22,7 +22,11 @@ var _text2 = require("../utils/text");
|
|
|
22
22
|
2. Escape |
|
|
23
23
|
3. Table of table
|
|
24
24
|
*/
|
|
25
|
+
// Ignored via go/ees005
|
|
26
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
25
27
|
var CELL_REGEXP = /^([ \t]*)([|]+)([ \t]*)/;
|
|
28
|
+
// Ignored via go/ees005
|
|
29
|
+
// eslint-disable-next-line require-unicode-regexp
|
|
26
30
|
var EMPTY_LINE_REGEXP = /^[ \t]*\r?\n/;
|
|
27
31
|
var processState = {
|
|
28
32
|
END_TABLE: 2,
|
|
@@ -304,6 +308,9 @@ function createTableHeader(node, schema) {
|
|
|
304
308
|
var mark = schema.marks.strong.create();
|
|
305
309
|
return traverseNodeAndAddMarks(node, mark, schema);
|
|
306
310
|
}
|
|
311
|
+
|
|
312
|
+
// Ignored via go/ees005
|
|
313
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
307
314
|
function traverseContent(node, mark, schema) {
|
|
308
315
|
if (node.content.childCount === 0 || !node.content.child(0) || !node.content.firstChild || node.type.name === 'codeBlock') {
|
|
309
316
|
return node;
|