@doist/typist 4.0.1 → 4.0.2

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
+ ## [4.0.2](https://github.com/Doist/typist/compare/v4.0.1...v4.0.2) (2024-02-08)
2
+
3
+ ### Bug Fixes
4
+
5
+ - **bold-and-italics:** Disallow only whitespace in the markdown shortcuts ([#651](https://github.com/Doist/typist/issues/651)) ([4c740dd](https://github.com/Doist/typist/commit/4c740ddedc487ad27f2fc8b56e2440913911e40f))
6
+
1
7
  ## [4.0.1](https://github.com/Doist/typist/compare/v4.0.0...v4.0.1) (2024-02-07)
2
8
 
3
9
  ### Bug Fixes
@@ -1,4 +1,8 @@
1
1
  import { Mark } from '@tiptap/core';
2
+ export declare const starInputRegex: RegExp;
3
+ export declare const starPasteRegex: RegExp;
4
+ export declare const underscoreInputRegex: RegExp;
5
+ export declare const underscorePasteRegex: RegExp;
2
6
  /**
3
7
  * The `BoldAndItalics` extension adds the ability to use the `***` and `___` Markdown shortcuts
4
8
  * when typing and pasting into the editor.
@@ -1 +1 @@
1
- {"version":3,"file":"bold-and-italics.d.ts","sourceRoot":"","sources":["../../../src/extensions/rich-text/bold-and-italics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAgC,MAAM,cAAc,CAAA;AAOjE;;;GAGG;AACH,QAAA,MAAM,cAAc,gBA6BlB,CAAA;AAEF,OAAO,EAAE,cAAc,EAAE,CAAA"}
1
+ {"version":3,"file":"bold-and-italics.d.ts","sourceRoot":"","sources":["../../../src/extensions/rich-text/bold-and-italics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAgC,MAAM,cAAc,CAAA;AAEjE,eAAO,MAAM,cAAc,QAAiE,CAAA;AAC5F,eAAO,MAAM,cAAc,QAAiE,CAAA;AAC5F,eAAO,MAAM,oBAAoB,QAAqD,CAAA;AACtF,eAAO,MAAM,oBAAoB,QAAqD,CAAA;AAEtF;;;GAGG;AACH,QAAA,MAAM,cAAc,gBA6BlB,CAAA;AAEF,OAAO,EAAE,cAAc,EAAE,CAAA"}
@@ -1,8 +1,8 @@
1
1
  import { Mark, markInputRule, markPasteRule } from '@tiptap/core';
2
- const starInputRegex = /(?:^|\s)((?:\*{3})((?:[^*]+))(?:\*{3}))$/;
3
- const starPasteRegex = /(?:^|\s)((?:\*{3})((?:[^*]+))(?:\*{3}))/g;
4
- const underscoreInputRegex = /(?:^|\s)((?:_{3})((?:[^_]+))(?:_{3}))$/;
5
- const underscorePasteRegex = /(?:^|\s)((?:_{3})((?:[^_]+))(?:_{3}))/g;
2
+ export const starInputRegex = /(?:^|\s)(\*\*\*(?!\s+\*\*\*)((?:[^*]+))\*\*\*(?!\s+\*\*\*))$/;
3
+ export const starPasteRegex = /(?:^|\s)(\*\*\*(?!\s+\*\*\*)((?:[^*]+))\*\*\*(?!\s+\*\*\*))/g;
4
+ export const underscoreInputRegex = /(?:^|\s)(___(?!\s+___)((?:[^_]+))___(?!\s+___))$/;
5
+ export const underscorePasteRegex = /(?:^|\s)(___(?!\s+___)((?:[^_]+))___(?!\s+___))/g;
6
6
  /**
7
7
  * The `BoldAndItalics` extension adds the ability to use the `***` and `___` Markdown shortcuts
8
8
  * when typing and pasting into the editor.
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": "4.0.1",
4
+ "version": "4.0.2",
5
5
  "license": "MIT",
6
6
  "homepage": "https://typist.doist.dev/",
7
7
  "repository": "https://github.com/Doist/typist",
@@ -100,7 +100,7 @@
100
100
  "@testing-library/react": "14.2.1",
101
101
  "@types/hast": "3.0.4",
102
102
  "@types/lodash-es": "4.17.12",
103
- "@types/react": "18.2.51",
103
+ "@types/react": "18.2.52",
104
104
  "@types/react-dom": "18.2.18",
105
105
  "@types/react-syntax-highlighter": "15.5.11",
106
106
  "@types/turndown": "5.0.4",