@doist/typist 1.0.8 → 1.0.9

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,3 +1,9 @@
1
+ ## [1.0.9](https://github.com/Doist/typist/compare/v1.0.8...v1.0.9) (2022-12-19)
2
+
3
+ ### Bug Fixes
4
+
5
+ - **rich-text-link:** More lenient regex for input/paste rule ([#72](https://github.com/Doist/typist/issues/72)) ([98e363f](https://github.com/Doist/typist/commit/98e363f27e6e403a775ca8fe729ce17dbdf721df))
6
+
1
7
  ## [1.0.8](https://github.com/Doist/typist/compare/v1.0.7...v1.0.8) (2022-12-19)
2
8
 
3
9
  ### Bug Fixes
@@ -1 +1 @@
1
- {"version":3,"file":"rich-text-link.d.ts","sourceRoot":"","sources":["../../../src/extensions/rich-text/rich-text-link.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AA2DzD;;;;GAIG;AACH,QAAA,MAAM,YAAY,+CA8ChB,CAAA;AAEF,OAAO,EAAE,YAAY,EAAE,CAAA;AAEvB,YAAY,EAAE,WAAW,IAAI,mBAAmB,EAAE,CAAA"}
1
+ {"version":3,"file":"rich-text-link.d.ts","sourceRoot":"","sources":["../../../src/extensions/rich-text/rich-text-link.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAuDzD;;;;GAIG;AACH,QAAA,MAAM,YAAY,+CA8ChB,CAAA;AAEF,OAAO,EAAE,YAAY,EAAE,CAAA;AAEvB,YAAY,EAAE,WAAW,IAAI,mBAAmB,EAAE,CAAA"}
@@ -3,17 +3,13 @@ import { Link } from '@tiptap/extension-link';
3
3
  /**
4
4
  * The input regex for Markdown links with title support, and multiple quotation marks (required
5
5
  * in case the `Typography` extension is being included).
6
- *
7
- * @see https://stephenweiss.dev/regex-markdown-link
8
6
  */
9
- const inputRegex = /(?:^|\s)\[([^\]]*)?\]\(([A-Za-z0-9:/.-?]+)(?: ["“](.+)["”])?\)$/;
7
+ const inputRegex = /(?:^|\s)\[([^\]]*)?\]\((\S+)(?: ["“](.+)["”])?\)$/i;
10
8
  /**
11
9
  * The paste regex for Markdown links with title support, and multiple quotation marks (required
12
10
  * in case the `Typography` extension is being included).
13
- *
14
- * @see https://stephenweiss.dev/regex-markdown-link
15
11
  */
16
- const pasteRegex = /(?:^|\s)\[([^\]]*)?\]\(([A-Za-z0-9:/.-?]+)(?: ["“](.+)["”])?\)/g;
12
+ const pasteRegex = /(?:^|\s)\[([^\]]*)?\]\((\S+)(?: ["“](.+)["”])?\)/gi;
17
13
  /**
18
14
  * Input rule built specifically for the `Link` extension, which ignores the auto-linked URL in
19
15
  * parentheses (e.g., `(https://doist.dev)`).
@@ -24,7 +20,7 @@ function linkInputRule(config) {
24
20
  const defaultMarkInputRule = markInputRule(config);
25
21
  return new InputRule({
26
22
  find: config.find,
27
- handler: (props) => {
23
+ handler(props) {
28
24
  const { tr } = props.state;
29
25
  defaultMarkInputRule.handler(props);
30
26
  tr.setMeta('preventAutolink', true);
@@ -42,7 +38,7 @@ function linkPasteRule(config) {
42
38
  const defaultMarkInputRule = markPasteRule(config);
43
39
  return new PasteRule({
44
40
  find: config.find,
45
- handler: (props) => {
41
+ handler(props) {
46
42
  const { tr } = props.state;
47
43
  defaultMarkInputRule.handler(props);
48
44
  tr.setMeta('preventAutolink', true);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@doist/typist",
3
3
  "description": "The mighty Tiptap-based rich-text editor React component that powers Doist products.",
4
- "version": "1.0.8",
4
+ "version": "1.0.9",
5
5
  "license": "MIT",
6
6
  "homepage": "https://typist.doist.dev/",
7
7
  "repository": "https://github.com/Doist/typist",
@@ -82,15 +82,15 @@
82
82
  "devDependencies": {
83
83
  "@doist/eslint-config": "8.1.3",
84
84
  "@doist/prettier-config": "3.0.5",
85
- "@doist/reactist": "17.4.0",
86
- "@mdx-js/react": "2.1.5",
85
+ "@doist/reactist": "17.5.0",
86
+ "@mdx-js/react": "2.2.1",
87
87
  "@semantic-release/changelog": "6.0.2",
88
88
  "@semantic-release/exec": "6.0.3",
89
89
  "@semantic-release/git": "10.0.1",
90
90
  "@storybook/addon-a11y": "6.5.14",
91
91
  "@storybook/addon-essentials": "6.5.14",
92
92
  "@storybook/addons": "6.5.14",
93
- "@storybook/builder-vite": "0.2.5",
93
+ "@storybook/builder-vite": "0.2.6",
94
94
  "@storybook/mdx2-csf": "0.0.3",
95
95
  "@storybook/react": "6.5.14",
96
96
  "@testing-library/dom": "8.19.0",
@@ -112,7 +112,7 @@
112
112
  "eslint-import-resolver-typescript": "3.5.2",
113
113
  "eslint-plugin-jest": "27.1.6",
114
114
  "eslint-plugin-simple-import-sort": "8.0.0",
115
- "eslint-plugin-unicorn": "45.0.1",
115
+ "eslint-plugin-unicorn": "45.0.2",
116
116
  "github-markdown-css": "5.1.0",
117
117
  "husky": "8.0.2",
118
118
  "ignore-sync": "6.0.2",
@@ -132,7 +132,7 @@
132
132
  "storybook-css-modules": "1.0.8",
133
133
  "ts-jest": "29.0.3",
134
134
  "ts-node": "10.9.1",
135
- "type-fest": "3.3.0",
135
+ "type-fest": "3.4.0",
136
136
  "typescript": "4.9.4",
137
137
  "typescript-plugin-css-modules": "4.1.1"
138
138
  },