@atlaskit/editor-wikimarkup-transformer 9.5.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 +2299 -0
- package/LICENSE +13 -0
- package/build/tsconfig.json +17 -0
- package/char/package.json +7 -0
- package/dist/cjs/char.js +8 -0
- package/dist/cjs/encoder/emoji-unicode-mapping.js +1618 -0
- package/dist/cjs/encoder/index.js +76 -0
- package/dist/cjs/encoder/marks/__base.js +24 -0
- package/dist/cjs/encoder/marks/code.js +12 -0
- package/dist/cjs/encoder/marks/color.js +12 -0
- package/dist/cjs/encoder/marks/em.js +19 -0
- package/dist/cjs/encoder/marks/link.js +12 -0
- package/dist/cjs/encoder/marks/strike.js +14 -0
- package/dist/cjs/encoder/marks/strong.js +18 -0
- package/dist/cjs/encoder/marks/subsup.js +18 -0
- package/dist/cjs/encoder/marks/underline.js +14 -0
- package/dist/cjs/encoder/nodes/block-card.js +18 -0
- package/dist/cjs/encoder/nodes/blockquote.js +21 -0
- package/dist/cjs/encoder/nodes/bullet-list.js +21 -0
- package/dist/cjs/encoder/nodes/code-block.js +27 -0
- package/dist/cjs/encoder/nodes/date.js +21 -0
- package/dist/cjs/encoder/nodes/decisionItem.js +23 -0
- package/dist/cjs/encoder/nodes/decisionList.js +18 -0
- package/dist/cjs/encoder/nodes/doc.js +21 -0
- package/dist/cjs/encoder/nodes/embed-card.js +18 -0
- package/dist/cjs/encoder/nodes/emoji.js +26 -0
- package/dist/cjs/encoder/nodes/expand.js +22 -0
- package/dist/cjs/encoder/nodes/hard-break.js +12 -0
- package/dist/cjs/encoder/nodes/heading.js +18 -0
- package/dist/cjs/encoder/nodes/inline-card.js +26 -0
- package/dist/cjs/encoder/nodes/inlines.js +44 -0
- package/dist/cjs/encoder/nodes/listItem.js +77 -0
- package/dist/cjs/encoder/nodes/media-group.js +24 -0
- package/dist/cjs/encoder/nodes/media.js +66 -0
- package/dist/cjs/encoder/nodes/mention.js +27 -0
- package/dist/cjs/encoder/nodes/ordered-list.js +21 -0
- package/dist/cjs/encoder/nodes/panel.js +29 -0
- package/dist/cjs/encoder/nodes/paragraph.js +23 -0
- package/dist/cjs/encoder/nodes/rule.js +12 -0
- package/dist/cjs/encoder/nodes/status.js +43 -0
- package/dist/cjs/encoder/nodes/table.js +77 -0
- package/dist/cjs/encoder/nodes/taskItem.js +32 -0
- package/dist/cjs/encoder/nodes/taskList.js +27 -0
- package/dist/cjs/encoder/nodes/text.js +67 -0
- package/dist/cjs/encoder/nodes/unknown.js +17 -0
- package/dist/cjs/index.js +93 -0
- package/dist/cjs/interfaces.js +5 -0
- package/dist/cjs/parser/abstract-tree.js +44 -0
- package/dist/cjs/parser/builder/list-builder.js +350 -0
- package/dist/cjs/parser/builder/table-builder.js +156 -0
- package/dist/cjs/parser/color.js +13 -0
- package/dist/cjs/parser/error.js +22 -0
- package/dist/cjs/parser/nodes/mediaGroup.js +25 -0
- package/dist/cjs/parser/nodes/mediaSingle.js +107 -0
- package/dist/cjs/parser/nodes/paragraph.js +72 -0
- package/dist/cjs/parser/nodes/rule.js +27 -0
- package/dist/cjs/parser/nodes/text.js +15 -0
- package/dist/cjs/parser/text.js +165 -0
- package/dist/cjs/parser/tokenize/adf-macro.js +49 -0
- package/dist/cjs/parser/tokenize/anchor-macro.js +31 -0
- package/dist/cjs/parser/tokenize/blockquote.js +42 -0
- package/dist/cjs/parser/tokenize/citation.js +71 -0
- package/dist/cjs/parser/tokenize/code-macro.js +95 -0
- package/dist/cjs/parser/tokenize/color-macro.js +64 -0
- package/dist/cjs/parser/tokenize/common-formatter.js +230 -0
- package/dist/cjs/parser/tokenize/common-macro.js +62 -0
- package/dist/cjs/parser/tokenize/dash-token-creator.js +42 -0
- package/dist/cjs/parser/tokenize/deleted.js +66 -0
- package/dist/cjs/parser/tokenize/double-dash-symbol.js +30 -0
- package/dist/cjs/parser/tokenize/emoji.js +184 -0
- package/dist/cjs/parser/tokenize/emphasis.js +65 -0
- package/dist/cjs/parser/tokenize/file-link.js +36 -0
- package/dist/cjs/parser/tokenize/force-line-break.js +48 -0
- package/dist/cjs/parser/tokenize/hardbreak.js +33 -0
- package/dist/cjs/parser/tokenize/heading.js +70 -0
- package/dist/cjs/parser/tokenize/index.js +144 -0
- package/dist/cjs/parser/tokenize/inserted.js +65 -0
- package/dist/cjs/parser/tokenize/issue-key.js +107 -0
- package/dist/cjs/parser/tokenize/keyword.js +159 -0
- package/dist/cjs/parser/tokenize/link-text.js +77 -0
- package/dist/cjs/parser/tokenize/links/attachment-link.js +18 -0
- package/dist/cjs/parser/tokenize/links/issue-link.js +41 -0
- package/dist/cjs/parser/tokenize/links/link-format.js +65 -0
- package/dist/cjs/parser/tokenize/links/link-parser.js +224 -0
- package/dist/cjs/parser/tokenize/links/link-resolver.js +57 -0
- package/dist/cjs/parser/tokenize/links/mention-link.js +24 -0
- package/dist/cjs/parser/tokenize/links/url-link.js +64 -0
- package/dist/cjs/parser/tokenize/list.js +339 -0
- package/dist/cjs/parser/tokenize/media.js +51 -0
- package/dist/cjs/parser/tokenize/monospace.js +59 -0
- package/dist/cjs/parser/tokenize/noformat-macro.js +46 -0
- package/dist/cjs/parser/tokenize/panel-macro.js +106 -0
- package/dist/cjs/parser/tokenize/quadruple-dash-symbol.js +30 -0
- package/dist/cjs/parser/tokenize/quote-macro.js +166 -0
- package/dist/cjs/parser/tokenize/ruler.js +33 -0
- package/dist/cjs/parser/tokenize/strong.js +65 -0
- package/dist/cjs/parser/tokenize/subscript.js +67 -0
- package/dist/cjs/parser/tokenize/superscript.js +67 -0
- package/dist/cjs/parser/tokenize/table.js +353 -0
- package/dist/cjs/parser/tokenize/triple-dash-symbol.js +30 -0
- package/dist/cjs/parser/tokenize/whitespace.js +56 -0
- package/dist/cjs/parser/utils/attrs.js +33 -0
- package/dist/cjs/parser/utils/color-name-mapping.js +700 -0
- package/dist/cjs/parser/utils/escape.js +36 -0
- package/dist/cjs/parser/utils/normalize.js +209 -0
- package/dist/cjs/parser/utils/panel-type.js +120 -0
- package/dist/cjs/parser/utils/text.js +98 -0
- package/dist/cjs/parser/utils/title.js +17 -0
- package/dist/cjs/parser/utils/url.js +31 -0
- package/dist/cjs/version.json +5 -0
- package/dist/es2019/char.js +1 -0
- package/dist/es2019/encoder/emoji-unicode-mapping.js +1611 -0
- package/dist/es2019/encoder/index.js +51 -0
- package/dist/es2019/encoder/marks/__base.js +15 -0
- package/dist/es2019/encoder/marks/code.js +3 -0
- package/dist/es2019/encoder/marks/color.js +3 -0
- package/dist/es2019/encoder/marks/em.js +9 -0
- package/dist/es2019/encoder/marks/link.js +3 -0
- package/dist/es2019/encoder/marks/strike.js +4 -0
- package/dist/es2019/encoder/marks/strong.js +9 -0
- package/dist/es2019/encoder/marks/subsup.js +8 -0
- package/dist/es2019/encoder/marks/underline.js +4 -0
- package/dist/es2019/encoder/nodes/block-card.js +8 -0
- package/dist/es2019/encoder/nodes/blockquote.js +10 -0
- package/dist/es2019/encoder/nodes/bullet-list.js +10 -0
- package/dist/es2019/encoder/nodes/code-block.js +16 -0
- package/dist/es2019/encoder/nodes/date.js +12 -0
- package/dist/es2019/encoder/nodes/decisionItem.js +12 -0
- package/dist/es2019/encoder/nodes/decisionList.js +8 -0
- package/dist/es2019/encoder/nodes/doc.js +10 -0
- package/dist/es2019/encoder/nodes/embed-card.js +8 -0
- package/dist/es2019/encoder/nodes/emoji.js +15 -0
- package/dist/es2019/encoder/nodes/expand.js +11 -0
- package/dist/es2019/encoder/nodes/hard-break.js +3 -0
- package/dist/es2019/encoder/nodes/heading.js +8 -0
- package/dist/es2019/encoder/nodes/inline-card.js +15 -0
- package/dist/es2019/encoder/nodes/inlines.js +26 -0
- package/dist/es2019/encoder/nodes/listItem.js +63 -0
- package/dist/es2019/encoder/nodes/media-group.js +13 -0
- package/dist/es2019/encoder/nodes/media.js +54 -0
- package/dist/es2019/encoder/nodes/mention.js +16 -0
- package/dist/es2019/encoder/nodes/ordered-list.js +10 -0
- package/dist/es2019/encoder/nodes/panel.js +19 -0
- package/dist/es2019/encoder/nodes/paragraph.js +12 -0
- package/dist/es2019/encoder/nodes/rule.js +3 -0
- package/dist/es2019/encoder/nodes/status.js +23 -0
- package/dist/es2019/encoder/nodes/table.js +62 -0
- package/dist/es2019/encoder/nodes/taskItem.js +21 -0
- package/dist/es2019/encoder/nodes/taskList.js +17 -0
- package/dist/es2019/encoder/nodes/text.js +46 -0
- package/dist/es2019/encoder/nodes/unknown.js +8 -0
- package/dist/es2019/index.js +58 -0
- package/dist/es2019/interfaces.js +1 -0
- package/dist/es2019/parser/abstract-tree.js +23 -0
- package/dist/es2019/parser/builder/list-builder.js +294 -0
- package/dist/es2019/parser/builder/table-builder.js +135 -0
- package/dist/es2019/parser/color.js +5 -0
- package/dist/es2019/parser/error.js +15 -0
- package/dist/es2019/parser/nodes/mediaGroup.js +18 -0
- package/dist/es2019/parser/nodes/mediaSingle.js +95 -0
- package/dist/es2019/parser/nodes/paragraph.js +43 -0
- package/dist/es2019/parser/nodes/rule.js +21 -0
- package/dist/es2019/parser/nodes/text.js +8 -0
- package/dist/es2019/parser/text.js +145 -0
- package/dist/es2019/parser/tokenize/adf-macro.js +40 -0
- package/dist/es2019/parser/tokenize/anchor-macro.js +22 -0
- package/dist/es2019/parser/tokenize/blockquote.js +26 -0
- package/dist/es2019/parser/tokenize/citation.js +53 -0
- package/dist/es2019/parser/tokenize/code-macro.js +57 -0
- package/dist/es2019/parser/tokenize/color-macro.js +46 -0
- package/dist/es2019/parser/tokenize/common-formatter.js +215 -0
- package/dist/es2019/parser/tokenize/common-macro.js +48 -0
- package/dist/es2019/parser/tokenize/dash-token-creator.js +31 -0
- package/dist/es2019/parser/tokenize/deleted.js +49 -0
- package/dist/es2019/parser/tokenize/double-dash-symbol.js +11 -0
- package/dist/es2019/parser/tokenize/emoji.js +174 -0
- package/dist/es2019/parser/tokenize/emphasis.js +48 -0
- package/dist/es2019/parser/tokenize/file-link.js +25 -0
- package/dist/es2019/parser/tokenize/force-line-break.js +38 -0
- package/dist/es2019/parser/tokenize/hardbreak.js +24 -0
- package/dist/es2019/parser/tokenize/heading.js +58 -0
- package/dist/es2019/parser/tokenize/index.js +129 -0
- package/dist/es2019/parser/tokenize/inserted.js +48 -0
- package/dist/es2019/parser/tokenize/issue-key.js +81 -0
- package/dist/es2019/parser/tokenize/keyword.js +142 -0
- package/dist/es2019/parser/tokenize/link-text.js +65 -0
- package/dist/es2019/parser/tokenize/links/attachment-link.js +8 -0
- package/dist/es2019/parser/tokenize/links/issue-link.js +35 -0
- package/dist/es2019/parser/tokenize/links/link-format.js +52 -0
- package/dist/es2019/parser/tokenize/links/link-parser.js +208 -0
- package/dist/es2019/parser/tokenize/links/link-resolver.js +39 -0
- package/dist/es2019/parser/tokenize/links/mention-link.js +17 -0
- package/dist/es2019/parser/tokenize/links/url-link.js +49 -0
- package/dist/es2019/parser/tokenize/list.js +296 -0
- package/dist/es2019/parser/tokenize/media.js +30 -0
- package/dist/es2019/parser/tokenize/monospace.js +47 -0
- package/dist/es2019/parser/tokenize/noformat-macro.js +37 -0
- package/dist/es2019/parser/tokenize/panel-macro.js +63 -0
- package/dist/es2019/parser/tokenize/quadruple-dash-symbol.js +22 -0
- package/dist/es2019/parser/tokenize/quote-macro.js +129 -0
- package/dist/es2019/parser/tokenize/ruler.js +23 -0
- package/dist/es2019/parser/tokenize/strong.js +48 -0
- package/dist/es2019/parser/tokenize/subscript.js +50 -0
- package/dist/es2019/parser/tokenize/superscript.js +50 -0
- package/dist/es2019/parser/tokenize/table.js +333 -0
- package/dist/es2019/parser/tokenize/triple-dash-symbol.js +11 -0
- package/dist/es2019/parser/tokenize/whitespace.js +45 -0
- package/dist/es2019/parser/utils/attrs.js +17 -0
- package/dist/es2019/parser/utils/color-name-mapping.js +693 -0
- package/dist/es2019/parser/utils/escape.js +28 -0
- package/dist/es2019/parser/utils/normalize.js +161 -0
- package/dist/es2019/parser/utils/panel-type.js +109 -0
- package/dist/es2019/parser/utils/text.js +58 -0
- package/dist/es2019/parser/utils/title.js +10 -0
- package/dist/es2019/parser/utils/url.js +24 -0
- package/dist/es2019/version.json +5 -0
- package/dist/esm/char.js +1 -0
- package/dist/esm/encoder/emoji-unicode-mapping.js +1611 -0
- package/dist/esm/encoder/index.js +51 -0
- package/dist/esm/encoder/marks/__base.js +15 -0
- package/dist/esm/encoder/marks/code.js +3 -0
- package/dist/esm/encoder/marks/color.js +3 -0
- package/dist/esm/encoder/marks/em.js +9 -0
- package/dist/esm/encoder/marks/link.js +3 -0
- package/dist/esm/encoder/marks/strike.js +4 -0
- package/dist/esm/encoder/marks/strong.js +9 -0
- package/dist/esm/encoder/marks/subsup.js +8 -0
- package/dist/esm/encoder/marks/underline.js +4 -0
- package/dist/esm/encoder/nodes/block-card.js +8 -0
- package/dist/esm/encoder/nodes/blockquote.js +11 -0
- package/dist/esm/encoder/nodes/bullet-list.js +11 -0
- package/dist/esm/encoder/nodes/code-block.js +16 -0
- package/dist/esm/encoder/nodes/date.js +12 -0
- package/dist/esm/encoder/nodes/decisionItem.js +13 -0
- package/dist/esm/encoder/nodes/decisionList.js +8 -0
- package/dist/esm/encoder/nodes/doc.js +11 -0
- package/dist/esm/encoder/nodes/embed-card.js +8 -0
- package/dist/esm/encoder/nodes/emoji.js +15 -0
- package/dist/esm/encoder/nodes/expand.js +12 -0
- package/dist/esm/encoder/nodes/hard-break.js +3 -0
- package/dist/esm/encoder/nodes/heading.js +8 -0
- package/dist/esm/encoder/nodes/inline-card.js +15 -0
- package/dist/esm/encoder/nodes/inlines.js +26 -0
- package/dist/esm/encoder/nodes/listItem.js +63 -0
- package/dist/esm/encoder/nodes/media-group.js +14 -0
- package/dist/esm/encoder/nodes/media.js +57 -0
- package/dist/esm/encoder/nodes/mention.js +19 -0
- package/dist/esm/encoder/nodes/ordered-list.js +11 -0
- package/dist/esm/encoder/nodes/panel.js +18 -0
- package/dist/esm/encoder/nodes/paragraph.js +13 -0
- package/dist/esm/encoder/nodes/rule.js +3 -0
- package/dist/esm/encoder/nodes/status.js +29 -0
- package/dist/esm/encoder/nodes/table.js +66 -0
- package/dist/esm/encoder/nodes/taskItem.js +22 -0
- package/dist/esm/encoder/nodes/taskList.js +18 -0
- package/dist/esm/encoder/nodes/text.js +51 -0
- package/dist/esm/encoder/nodes/unknown.js +6 -0
- package/dist/esm/index.js +78 -0
- package/dist/esm/interfaces.js +1 -0
- package/dist/esm/parser/abstract-tree.js +34 -0
- package/dist/esm/parser/builder/list-builder.js +338 -0
- package/dist/esm/parser/builder/table-builder.js +150 -0
- package/dist/esm/parser/color.js +5 -0
- package/dist/esm/parser/error.js +15 -0
- package/dist/esm/parser/nodes/mediaGroup.js +18 -0
- package/dist/esm/parser/nodes/mediaSingle.js +97 -0
- package/dist/esm/parser/nodes/paragraph.js +61 -0
- package/dist/esm/parser/nodes/rule.js +18 -0
- package/dist/esm/parser/nodes/text.js +8 -0
- package/dist/esm/parser/text.js +149 -0
- package/dist/esm/parser/tokenize/adf-macro.js +39 -0
- package/dist/esm/parser/tokenize/anchor-macro.js +21 -0
- package/dist/esm/parser/tokenize/blockquote.js +28 -0
- package/dist/esm/parser/tokenize/citation.js +54 -0
- package/dist/esm/parser/tokenize/code-macro.js +80 -0
- package/dist/esm/parser/tokenize/color-macro.js +46 -0
- package/dist/esm/parser/tokenize/common-formatter.js +216 -0
- package/dist/esm/parser/tokenize/common-macro.js +52 -0
- package/dist/esm/parser/tokenize/dash-token-creator.js +33 -0
- package/dist/esm/parser/tokenize/deleted.js +50 -0
- package/dist/esm/parser/tokenize/double-dash-symbol.js +19 -0
- package/dist/esm/parser/tokenize/emoji.js +173 -0
- package/dist/esm/parser/tokenize/emphasis.js +49 -0
- package/dist/esm/parser/tokenize/file-link.js +25 -0
- package/dist/esm/parser/tokenize/force-line-break.js +38 -0
- package/dist/esm/parser/tokenize/hardbreak.js +23 -0
- package/dist/esm/parser/tokenize/heading.js +58 -0
- package/dist/esm/parser/tokenize/index.js +102 -0
- package/dist/esm/parser/tokenize/inserted.js +49 -0
- package/dist/esm/parser/tokenize/issue-key.js +89 -0
- package/dist/esm/parser/tokenize/keyword.js +142 -0
- package/dist/esm/parser/tokenize/link-text.js +64 -0
- package/dist/esm/parser/tokenize/links/attachment-link.js +8 -0
- package/dist/esm/parser/tokenize/links/issue-link.js +33 -0
- package/dist/esm/parser/tokenize/links/link-format.js +51 -0
- package/dist/esm/parser/tokenize/links/link-parser.js +213 -0
- package/dist/esm/parser/tokenize/links/link-resolver.js +55 -0
- package/dist/esm/parser/tokenize/links/mention-link.js +17 -0
- package/dist/esm/parser/tokenize/links/url-link.js +50 -0
- package/dist/esm/parser/tokenize/list.js +318 -0
- package/dist/esm/parser/tokenize/media.js +36 -0
- package/dist/esm/parser/tokenize/monospace.js +47 -0
- package/dist/esm/parser/tokenize/noformat-macro.js +34 -0
- package/dist/esm/parser/tokenize/panel-macro.js +88 -0
- package/dist/esm/parser/tokenize/quadruple-dash-symbol.js +21 -0
- package/dist/esm/parser/tokenize/quote-macro.js +148 -0
- package/dist/esm/parser/tokenize/ruler.js +22 -0
- package/dist/esm/parser/tokenize/strong.js +49 -0
- package/dist/esm/parser/tokenize/subscript.js +51 -0
- package/dist/esm/parser/tokenize/superscript.js +51 -0
- package/dist/esm/parser/tokenize/table.js +336 -0
- package/dist/esm/parser/tokenize/triple-dash-symbol.js +19 -0
- package/dist/esm/parser/tokenize/whitespace.js +45 -0
- package/dist/esm/parser/utils/attrs.js +23 -0
- package/dist/esm/parser/utils/color-name-mapping.js +693 -0
- package/dist/esm/parser/utils/escape.js +28 -0
- package/dist/esm/parser/utils/normalize.js +195 -0
- package/dist/esm/parser/utils/panel-type.js +109 -0
- package/dist/esm/parser/utils/text.js +81 -0
- package/dist/esm/parser/utils/title.js +10 -0
- package/dist/esm/parser/utils/url.js +24 -0
- package/dist/esm/version.json +5 -0
- package/dist/types/char.d.ts +1 -0
- package/dist/types/encoder/emoji-unicode-mapping.d.ts +3 -0
- package/dist/types/encoder/index.d.ts +9 -0
- package/dist/types/encoder/marks/__base.d.ts +5 -0
- package/dist/types/encoder/marks/code.d.ts +2 -0
- package/dist/types/encoder/marks/color.d.ts +2 -0
- package/dist/types/encoder/marks/em.d.ts +2 -0
- package/dist/types/encoder/marks/link.d.ts +2 -0
- package/dist/types/encoder/marks/strike.d.ts +2 -0
- package/dist/types/encoder/marks/strong.d.ts +6 -0
- package/dist/types/encoder/marks/subsup.d.ts +2 -0
- package/dist/types/encoder/marks/underline.d.ts +2 -0
- package/dist/types/encoder/nodes/block-card.d.ts +2 -0
- package/dist/types/encoder/nodes/blockquote.d.ts +2 -0
- package/dist/types/encoder/nodes/bullet-list.d.ts +2 -0
- package/dist/types/encoder/nodes/code-block.d.ts +2 -0
- package/dist/types/encoder/nodes/date.d.ts +2 -0
- package/dist/types/encoder/nodes/decisionItem.d.ts +3 -0
- package/dist/types/encoder/nodes/decisionList.d.ts +2 -0
- package/dist/types/encoder/nodes/doc.d.ts +2 -0
- package/dist/types/encoder/nodes/embed-card.d.ts +2 -0
- package/dist/types/encoder/nodes/emoji.d.ts +2 -0
- package/dist/types/encoder/nodes/expand.d.ts +2 -0
- package/dist/types/encoder/nodes/hard-break.d.ts +2 -0
- package/dist/types/encoder/nodes/heading.d.ts +2 -0
- package/dist/types/encoder/nodes/inline-card.d.ts +2 -0
- package/dist/types/encoder/nodes/inlines.d.ts +2 -0
- package/dist/types/encoder/nodes/listItem.d.ts +3 -0
- package/dist/types/encoder/nodes/media-group.d.ts +2 -0
- package/dist/types/encoder/nodes/media.d.ts +2 -0
- package/dist/types/encoder/nodes/mention.d.ts +2 -0
- package/dist/types/encoder/nodes/ordered-list.d.ts +2 -0
- package/dist/types/encoder/nodes/panel.d.ts +2 -0
- package/dist/types/encoder/nodes/paragraph.d.ts +2 -0
- package/dist/types/encoder/nodes/rule.d.ts +2 -0
- package/dist/types/encoder/nodes/status.d.ts +2 -0
- package/dist/types/encoder/nodes/table.d.ts +2 -0
- package/dist/types/encoder/nodes/taskItem.d.ts +3 -0
- package/dist/types/encoder/nodes/taskList.d.ts +2 -0
- package/dist/types/encoder/nodes/text.d.ts +2 -0
- package/dist/types/encoder/nodes/unknown.d.ts +2 -0
- package/dist/types/index.d.ts +15 -0
- package/dist/types/interfaces.d.ts +68 -0
- package/dist/types/parser/abstract-tree.d.ts +11 -0
- package/dist/types/parser/builder/list-builder.d.ts +66 -0
- package/dist/types/parser/builder/table-builder.d.ts +45 -0
- package/dist/types/parser/color.d.ts +3 -0
- package/dist/types/parser/error.d.ts +1 -0
- package/dist/types/parser/nodes/mediaGroup.d.ts +3 -0
- package/dist/types/parser/nodes/mediaSingle.d.ts +5 -0
- package/dist/types/parser/nodes/paragraph.d.ts +7 -0
- package/dist/types/parser/nodes/rule.d.ts +3 -0
- package/dist/types/parser/nodes/text.d.ts +2 -0
- package/dist/types/parser/text.d.ts +10 -0
- package/dist/types/parser/tokenize/adf-macro.d.ts +2 -0
- package/dist/types/parser/tokenize/anchor-macro.d.ts +2 -0
- package/dist/types/parser/tokenize/blockquote.d.ts +2 -0
- package/dist/types/parser/tokenize/citation.d.ts +2 -0
- package/dist/types/parser/tokenize/code-macro.d.ts +2 -0
- package/dist/types/parser/tokenize/color-macro.d.ts +2 -0
- package/dist/types/parser/tokenize/common-formatter.d.ts +10 -0
- package/dist/types/parser/tokenize/common-macro.d.ts +10 -0
- package/dist/types/parser/tokenize/dash-token-creator.d.ts +2 -0
- package/dist/types/parser/tokenize/deleted.d.ts +2 -0
- package/dist/types/parser/tokenize/double-dash-symbol.d.ts +1 -0
- package/dist/types/parser/tokenize/emoji.d.ts +15 -0
- package/dist/types/parser/tokenize/emphasis.d.ts +2 -0
- package/dist/types/parser/tokenize/file-link.d.ts +3 -0
- package/dist/types/parser/tokenize/force-line-break.d.ts +2 -0
- package/dist/types/parser/tokenize/hardbreak.d.ts +2 -0
- package/dist/types/parser/tokenize/heading.d.ts +2 -0
- package/dist/types/parser/tokenize/index.d.ts +55 -0
- package/dist/types/parser/tokenize/inserted.d.ts +2 -0
- package/dist/types/parser/tokenize/issue-key.d.ts +20 -0
- package/dist/types/parser/tokenize/keyword.d.ts +13 -0
- package/dist/types/parser/tokenize/link-text.d.ts +3 -0
- package/dist/types/parser/tokenize/links/attachment-link.d.ts +4 -0
- package/dist/types/parser/tokenize/links/issue-link.d.ts +4 -0
- package/dist/types/parser/tokenize/links/link-format.d.ts +2 -0
- package/dist/types/parser/tokenize/links/link-parser.d.ts +17 -0
- package/dist/types/parser/tokenize/links/link-resolver.d.ts +5 -0
- package/dist/types/parser/tokenize/links/mention-link.d.ts +4 -0
- package/dist/types/parser/tokenize/links/url-link.d.ts +4 -0
- package/dist/types/parser/tokenize/list.d.ts +3 -0
- package/dist/types/parser/tokenize/media.d.ts +2 -0
- package/dist/types/parser/tokenize/monospace.d.ts +2 -0
- package/dist/types/parser/tokenize/noformat-macro.d.ts +2 -0
- package/dist/types/parser/tokenize/panel-macro.d.ts +2 -0
- package/dist/types/parser/tokenize/quadruple-dash-symbol.d.ts +2 -0
- package/dist/types/parser/tokenize/quote-macro.d.ts +5 -0
- package/dist/types/parser/tokenize/ruler.d.ts +2 -0
- package/dist/types/parser/tokenize/strong.d.ts +2 -0
- package/dist/types/parser/tokenize/subscript.d.ts +2 -0
- package/dist/types/parser/tokenize/superscript.d.ts +2 -0
- package/dist/types/parser/tokenize/table.d.ts +2 -0
- package/dist/types/parser/tokenize/triple-dash-symbol.d.ts +1 -0
- package/dist/types/parser/tokenize/whitespace.d.ts +3 -0
- package/dist/types/parser/utils/attrs.d.ts +3 -0
- package/dist/types/parser/utils/color-name-mapping.d.ts +10 -0
- package/dist/types/parser/utils/escape.d.ts +2 -0
- package/dist/types/parser/utils/normalize.d.ts +4 -0
- package/dist/types/parser/utils/panel-type.d.ts +3 -0
- package/dist/types/parser/utils/text.d.ts +21 -0
- package/dist/types/parser/utils/title.d.ts +7 -0
- package/dist/types/parser/utils/url.d.ts +8 -0
- package/docs/0-intro.tsx +24 -0
- package/interfaces/package.json +7 -0
- package/package.json +53 -0
- package/tsconfig.json +12 -0
- package/typings/json.d.ts +1 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
// TODO: Create a type for rawContentProcessor which will be shared among parsers
|
|
3
|
+
export function commonMacro(input, schema, opt) {
|
|
4
|
+
/**
|
|
5
|
+
* Forging the opening regex, the result would look something like
|
|
6
|
+
* /^\{(quote)(?::([^\{\n\}]*))?\}/i
|
|
7
|
+
*/
|
|
8
|
+
var opening = new RegExp("^{(".concat(opt.keyword, ")(?::([^{\n}]*))?}"), 'i');
|
|
9
|
+
var matchOpening = input.match(opening);
|
|
10
|
+
|
|
11
|
+
if (!matchOpening) {
|
|
12
|
+
return fallback(input);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
var _matchOpening = _slicedToArray(matchOpening, 3),
|
|
16
|
+
name = _matchOpening[1],
|
|
17
|
+
rawAttrs = _matchOpening[2];
|
|
18
|
+
|
|
19
|
+
var openingLength = matchOpening[0].length;
|
|
20
|
+
|
|
21
|
+
if (!opt.paired) {
|
|
22
|
+
/**
|
|
23
|
+
* Some macros do not have a closing symbol, for example
|
|
24
|
+
* {anchor:here} {loremipsum}
|
|
25
|
+
*/
|
|
26
|
+
return opt.rawContentProcessor(rawAttrs, '', openingLength, schema, opt.context);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Forging the closing regex, the result would look something like
|
|
30
|
+
* /\{quote\}/
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
var closing = new RegExp("{".concat(name, "}"));
|
|
35
|
+
var matchClosing = closing.exec(input.substring(openingLength));
|
|
36
|
+
var rawContent = '';
|
|
37
|
+
|
|
38
|
+
if (matchClosing) {
|
|
39
|
+
rawContent = input.substring(openingLength, openingLength + matchClosing.index);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
var length = matchClosing ? openingLength + matchClosing.index + matchClosing[0].length : openingLength;
|
|
43
|
+
return opt.rawContentProcessor(rawAttrs, rawContent, length, schema, opt.context);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function fallback(input) {
|
|
47
|
+
return {
|
|
48
|
+
type: 'text',
|
|
49
|
+
text: input.substr(0, 1),
|
|
50
|
+
length: 1
|
|
51
|
+
};
|
|
52
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export var createDashTokenParser = function createDashTokenParser(token, fallback) {
|
|
2
|
+
return function (_ref) {
|
|
3
|
+
var input = _ref.input,
|
|
4
|
+
position = _ref.position;
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* From Jira https://stash.atlassian.com/projects/JIRACLOUD/repos/jira/browse/jira-components/jira-renderer/src/main/java/com/atlassian/renderer/v2/components/phrase/DashRendererComponent.java
|
|
8
|
+
* public static final Replacer EN_DASH = new Replacer(Pattern.compile("(^|\\s)--(\\s|$)"), "$1–$2", "--");
|
|
9
|
+
* public static final Replacer EM_DASH = new Replacer(Pattern.compile("(^|\\s)---(\\s|$)"), "$1—$2", "---");
|
|
10
|
+
*/
|
|
11
|
+
if (position > 0) {
|
|
12
|
+
var charBeforeToken = input.charAt(position - 1);
|
|
13
|
+
|
|
14
|
+
if (!isSpace(charBeforeToken)) {
|
|
15
|
+
return fallback;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (position + token.length < input.length) {
|
|
20
|
+
var charAfterToken = input.charAt(position + token.length);
|
|
21
|
+
|
|
22
|
+
if (!isSpace(charAfterToken)) {
|
|
23
|
+
return fallback;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return token;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
var isSpace = function isSpace(char) {
|
|
32
|
+
return /\s/.test(char);
|
|
33
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import { TokenType } from './';
|
|
3
|
+
import { hasAnyOfMarks } from '../utils/text';
|
|
4
|
+
import { commonFormatter } from './common-formatter';
|
|
5
|
+
import { parseString } from '../text';
|
|
6
|
+
export var deleted = function deleted(_ref) {
|
|
7
|
+
var input = _ref.input,
|
|
8
|
+
position = _ref.position,
|
|
9
|
+
schema = _ref.schema,
|
|
10
|
+
context = _ref.context;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The following token types will be ignored in parsing
|
|
14
|
+
* the content
|
|
15
|
+
*/
|
|
16
|
+
var ignoreTokenTypes = [TokenType.DOUBLE_DASH_SYMBOL, TokenType.TRIPLE_DASH_SYMBOL, TokenType.QUADRUPLE_DASH_SYMBOL, TokenType.ISSUE_KEY, TokenType.TABLE];
|
|
17
|
+
/** Add strike mark to each text */
|
|
18
|
+
|
|
19
|
+
var contentDecorator = function contentDecorator(n) {
|
|
20
|
+
var mark = schema.marks.strike.create(); // We don't want to mix `code` mark with others
|
|
21
|
+
|
|
22
|
+
if (n.type.name === 'text' && !hasAnyOfMarks(n, ['strike', 'code'])) {
|
|
23
|
+
return n.mark([].concat(_toConsumableArray(n.marks), [mark]));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return n;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
var rawContentProcessor = function rawContentProcessor(raw, length) {
|
|
30
|
+
var content = parseString({
|
|
31
|
+
ignoreTokenTypes: ignoreTokenTypes,
|
|
32
|
+
schema: schema,
|
|
33
|
+
context: context,
|
|
34
|
+
input: raw
|
|
35
|
+
});
|
|
36
|
+
var decoratedContent = content.map(contentDecorator);
|
|
37
|
+
return {
|
|
38
|
+
type: 'pmnode',
|
|
39
|
+
nodes: decoratedContent,
|
|
40
|
+
length: length
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
return commonFormatter(input, position, schema, {
|
|
45
|
+
opening: '-',
|
|
46
|
+
closing: '-',
|
|
47
|
+
context: context,
|
|
48
|
+
rawContentProcessor: rawContentProcessor
|
|
49
|
+
});
|
|
50
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
|
|
5
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
6
|
+
|
|
7
|
+
import { createDashTokenParser } from './dash-token-creator';
|
|
8
|
+
var token = {
|
|
9
|
+
type: 'text',
|
|
10
|
+
text: "\u2013",
|
|
11
|
+
// EN DASH
|
|
12
|
+
length: 2
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
var fallback = _objectSpread(_objectSpread({}, token), {}, {
|
|
16
|
+
text: '--'
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export var doubleDashSymbol = createDashTokenParser(token, fallback);
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
var emptyOrWhitespaceRegex = new RegExp(/^$|\s/);
|
|
2
|
+
export var emoji = function emoji(_ref) {
|
|
3
|
+
var input = _ref.input,
|
|
4
|
+
position = _ref.position,
|
|
5
|
+
schema = _ref.schema;
|
|
6
|
+
var substring = input.substring(position);
|
|
7
|
+
/**
|
|
8
|
+
* The length of wikimakrup emoji test ranges from 2 to 9 characters at the time of writing.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
for (var i = 2; i <= 9 && i <= substring.length; ++i) {
|
|
12
|
+
var candidateText = substring.substring(0, i);
|
|
13
|
+
var emojiId = wikiToAdfEmojiMapping[candidateText]; // Is current candidate an emoji AND next character empty string or whitespace?
|
|
14
|
+
|
|
15
|
+
if (emojiId && emptyOrWhitespaceRegex.test(substring.charAt(i))) {
|
|
16
|
+
return {
|
|
17
|
+
type: 'pmnode',
|
|
18
|
+
nodes: [schema.nodes.emoji.createChecked(adfEmojiItems[emojiId])],
|
|
19
|
+
length: i
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
type: 'text',
|
|
26
|
+
text: substring.substr(0, 1),
|
|
27
|
+
length: 1
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export var adfEmojiItems = {
|
|
31
|
+
'1f642': {
|
|
32
|
+
id: '1f642',
|
|
33
|
+
shortName: ':slight_smile:',
|
|
34
|
+
text: '🙂'
|
|
35
|
+
},
|
|
36
|
+
'1f61e': {
|
|
37
|
+
id: '1f61e',
|
|
38
|
+
shortName: ':disappointed:',
|
|
39
|
+
text: '😞'
|
|
40
|
+
},
|
|
41
|
+
'1f61b': {
|
|
42
|
+
id: '1f61b',
|
|
43
|
+
shortName: ':stuck_out_tongue:',
|
|
44
|
+
text: '😛'
|
|
45
|
+
},
|
|
46
|
+
'1f603': {
|
|
47
|
+
id: '1f603',
|
|
48
|
+
shortName: ':smiley:',
|
|
49
|
+
text: '😃'
|
|
50
|
+
},
|
|
51
|
+
'1f609': {
|
|
52
|
+
id: '1f609',
|
|
53
|
+
shortName: ':wink:',
|
|
54
|
+
text: '😉'
|
|
55
|
+
},
|
|
56
|
+
'1f44d': {
|
|
57
|
+
id: '1f44d',
|
|
58
|
+
shortName: ':thumbsup:',
|
|
59
|
+
text: '👍'
|
|
60
|
+
},
|
|
61
|
+
'1f44e': {
|
|
62
|
+
id: '1f44e',
|
|
63
|
+
shortName: ':thumbsdown:',
|
|
64
|
+
text: '👎'
|
|
65
|
+
},
|
|
66
|
+
'atlassian-info': {
|
|
67
|
+
id: 'atlassian-info',
|
|
68
|
+
shortName: ':info:',
|
|
69
|
+
text: ':info'
|
|
70
|
+
},
|
|
71
|
+
'atlassian-check_mark': {
|
|
72
|
+
id: 'atlassian-check_mark',
|
|
73
|
+
shortName: ':check_mark:',
|
|
74
|
+
text: ':check_mark:'
|
|
75
|
+
},
|
|
76
|
+
'atlassian-cross_mark': {
|
|
77
|
+
id: 'atlassian-cross_mark',
|
|
78
|
+
shortName: ':cross_mark:',
|
|
79
|
+
text: ':cross_mark:'
|
|
80
|
+
},
|
|
81
|
+
'atlassian-warning': {
|
|
82
|
+
id: 'atlassian-warning',
|
|
83
|
+
shortName: ':warning:',
|
|
84
|
+
text: ':warning:'
|
|
85
|
+
},
|
|
86
|
+
'atlassian-plus': {
|
|
87
|
+
id: 'atlassian-plus',
|
|
88
|
+
shortName: ':plus:',
|
|
89
|
+
text: ':plus:'
|
|
90
|
+
},
|
|
91
|
+
'atlassian-minus': {
|
|
92
|
+
id: 'atlassian-minus',
|
|
93
|
+
shortName: ':minus:',
|
|
94
|
+
text: ':minus:'
|
|
95
|
+
},
|
|
96
|
+
'atlassian-question_mark': {
|
|
97
|
+
id: 'atlassian-question_mark',
|
|
98
|
+
shortName: ':question:',
|
|
99
|
+
text: ':question:'
|
|
100
|
+
},
|
|
101
|
+
'atlassian-light_bulb_on': {
|
|
102
|
+
id: 'atlassian-light_bulb_on',
|
|
103
|
+
shortName: ':light_bulb_on:',
|
|
104
|
+
text: ':light_bulb_on:'
|
|
105
|
+
},
|
|
106
|
+
'atlassian-light_bulb_off': {
|
|
107
|
+
id: 'atlassian-light_bulb_off',
|
|
108
|
+
shortName: ':light_bulb_off:',
|
|
109
|
+
text: ':light_bulb_off:'
|
|
110
|
+
},
|
|
111
|
+
'atlassian-yellow_star': {
|
|
112
|
+
id: 'atlassian-yellow_star',
|
|
113
|
+
shortName: ':yellow_star:',
|
|
114
|
+
text: ':yellow_star:'
|
|
115
|
+
},
|
|
116
|
+
'atlassian-red_star': {
|
|
117
|
+
id: 'atlassian-red_star',
|
|
118
|
+
shortName: ':red_star:',
|
|
119
|
+
text: ':red_star:'
|
|
120
|
+
},
|
|
121
|
+
'atlassian-green_star': {
|
|
122
|
+
id: 'atlassian-green_star',
|
|
123
|
+
shortName: ':green_star:',
|
|
124
|
+
text: ':green_star:'
|
|
125
|
+
},
|
|
126
|
+
'atlassian-blue_star': {
|
|
127
|
+
id: 'atlassian-blue_star',
|
|
128
|
+
shortName: ':blue_star:',
|
|
129
|
+
text: ':blue_star:'
|
|
130
|
+
},
|
|
131
|
+
'atlassian-flag_on': {
|
|
132
|
+
id: 'atlassian-flag_on',
|
|
133
|
+
shortName: ':flag_on:',
|
|
134
|
+
text: ':flag_on:'
|
|
135
|
+
},
|
|
136
|
+
'atlassian-flag_off': {
|
|
137
|
+
id: 'atlassian-flag_off',
|
|
138
|
+
shortName: ':flag_off:',
|
|
139
|
+
text: ':flag_off:'
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
export var wikiToAdfEmojiMapping = {
|
|
143
|
+
':)': '1f642',
|
|
144
|
+
':-)': '1f642',
|
|
145
|
+
':(': '1f61e',
|
|
146
|
+
':-(': '1f61e',
|
|
147
|
+
':P': '1f61b',
|
|
148
|
+
':-P': '1f61b',
|
|
149
|
+
':p': '1f61b',
|
|
150
|
+
':-p': '1f61b',
|
|
151
|
+
':D': '1f603',
|
|
152
|
+
':-D': '1f603',
|
|
153
|
+
';)': '1f609',
|
|
154
|
+
';-)': '1f609',
|
|
155
|
+
'(y)': '1f44d',
|
|
156
|
+
'(n)': '1f44e',
|
|
157
|
+
'(i)': 'atlassian-info',
|
|
158
|
+
'(/)': 'atlassian-check_mark',
|
|
159
|
+
'(x)': 'atlassian-cross_mark',
|
|
160
|
+
'(!)': 'atlassian-warning',
|
|
161
|
+
'(+)': 'atlassian-plus',
|
|
162
|
+
'(-)': 'atlassian-minus',
|
|
163
|
+
'(?)': 'atlassian-question_mark',
|
|
164
|
+
'(on)': 'atlassian-light_bulb_on',
|
|
165
|
+
'(off)': 'atlassian-light_bulb_off',
|
|
166
|
+
'(*)': 'atlassian-yellow_star',
|
|
167
|
+
'(*y)': 'atlassian-yellow_star',
|
|
168
|
+
'(*r)': 'atlassian-red_star',
|
|
169
|
+
'(*g)': 'atlassian-green_star',
|
|
170
|
+
'(*b)': 'atlassian-blue_star',
|
|
171
|
+
'(flag)': 'atlassian-flag_on',
|
|
172
|
+
'(flagoff)': 'atlassian-flag_off'
|
|
173
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import { TokenType } from './';
|
|
3
|
+
import { hasAnyOfMarks } from '../utils/text';
|
|
4
|
+
import { commonFormatter } from './common-formatter';
|
|
5
|
+
import { parseString } from '../text';
|
|
6
|
+
export var emphasis = function emphasis(_ref) {
|
|
7
|
+
var input = _ref.input,
|
|
8
|
+
position = _ref.position,
|
|
9
|
+
schema = _ref.schema,
|
|
10
|
+
context = _ref.context;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The following token types will be ignored in parsing
|
|
14
|
+
* the content of a mark
|
|
15
|
+
*/
|
|
16
|
+
var ignoreTokenTypes = [TokenType.DOUBLE_DASH_SYMBOL, TokenType.TRIPLE_DASH_SYMBOL, TokenType.QUADRUPLE_DASH_SYMBOL, TokenType.ISSUE_KEY, TokenType.TABLE]; // Add underline mark to each text
|
|
17
|
+
|
|
18
|
+
var contentDecorator = function contentDecorator(n) {
|
|
19
|
+
var mark = schema.marks.em.create(); // We don't want to mix `code` mark with others
|
|
20
|
+
|
|
21
|
+
if (n.type.name === 'text' && !hasAnyOfMarks(n, ['em', 'code'])) {
|
|
22
|
+
return n.mark([].concat(_toConsumableArray(n.marks), [mark]));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return n;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
var rawContentProcessor = function rawContentProcessor(raw, length) {
|
|
29
|
+
var content = parseString({
|
|
30
|
+
ignoreTokenTypes: ignoreTokenTypes,
|
|
31
|
+
schema: schema,
|
|
32
|
+
context: context,
|
|
33
|
+
input: raw
|
|
34
|
+
});
|
|
35
|
+
var decoratedContent = content.map(contentDecorator);
|
|
36
|
+
return {
|
|
37
|
+
type: 'pmnode',
|
|
38
|
+
nodes: decoratedContent,
|
|
39
|
+
length: length
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
return commonFormatter(input, position, schema, {
|
|
44
|
+
opening: '_',
|
|
45
|
+
closing: '_',
|
|
46
|
+
context: context,
|
|
47
|
+
rawContentProcessor: rawContentProcessor
|
|
48
|
+
});
|
|
49
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import getMediaGroupNodeView from '../nodes/mediaGroup';
|
|
2
|
+
// [^attachment.pdf]
|
|
3
|
+
var FILE_LINK_REGEXP = /^\[\^([\(\)\w. -]+)\]/;
|
|
4
|
+
export function fileLink(input, position, schema) {
|
|
5
|
+
var match = input.substring(position).match(FILE_LINK_REGEXP);
|
|
6
|
+
|
|
7
|
+
if (!match) {
|
|
8
|
+
return fallback(input, position);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
var node = getMediaGroupNodeView(schema, match[1]);
|
|
12
|
+
return {
|
|
13
|
+
type: 'pmnode',
|
|
14
|
+
nodes: [node],
|
|
15
|
+
length: match[0].length
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function fallback(input, position) {
|
|
20
|
+
return {
|
|
21
|
+
type: 'text',
|
|
22
|
+
text: input.substr(position, 1),
|
|
23
|
+
length: 1
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Jira is using the following regex to match force line break
|
|
3
|
+
* private static final Pattern FORCE_NEWLINE = Pattern.compile("(?<!\\\\)\\\\{2}(?!\\S*\\\\)");
|
|
4
|
+
*/
|
|
5
|
+
var FORCE_LINE_BREAK_REGEX = /^\\{2}(?!\S*\\)/;
|
|
6
|
+
export var forceLineBreak = function forceLineBreak(_ref) {
|
|
7
|
+
var input = _ref.input,
|
|
8
|
+
position = _ref.position,
|
|
9
|
+
schema = _ref.schema;
|
|
10
|
+
|
|
11
|
+
if (position > 0) {
|
|
12
|
+
var charBefore = input.charAt(position - 1);
|
|
13
|
+
|
|
14
|
+
if (charBefore === '\\') {
|
|
15
|
+
return fallback(input, position);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
var match = input.substring(position).match(FORCE_LINE_BREAK_REGEX);
|
|
20
|
+
|
|
21
|
+
if (match) {
|
|
22
|
+
return {
|
|
23
|
+
type: 'pmnode',
|
|
24
|
+
nodes: [schema.nodes.hardBreak.createChecked()],
|
|
25
|
+
length: 2
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
return fallback(input, position);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
function fallback(input, position) {
|
|
33
|
+
return {
|
|
34
|
+
type: 'text',
|
|
35
|
+
text: input.substr(position, 2),
|
|
36
|
+
length: 2
|
|
37
|
+
};
|
|
38
|
+
}
|