@doist/typist 4.0.4 → 4.0.5
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.5](https://github.com/Doist/typist/compare/v4.0.4...v4.0.5) (2024-03-06)
|
|
2
|
+
|
|
3
|
+
### Bug Fixes
|
|
4
|
+
|
|
5
|
+
- Prevent extra blank lines on list items ([#685](https://github.com/Doist/typist/issues/685)) ([b538ebe](https://github.com/Doist/typist/commit/b538ebef9a43d6b1af2f68efcdad445ec9e0cc17))
|
|
6
|
+
|
|
1
7
|
## [4.0.4](https://github.com/Doist/typist/compare/v4.0.3...v4.0.4) (2024-03-06)
|
|
2
8
|
|
|
3
9
|
### Bug Fixes
|
|
@@ -2,7 +2,8 @@ import type { NodeType } from '@tiptap/pm/model';
|
|
|
2
2
|
import type Turndown from 'turndown';
|
|
3
3
|
/**
|
|
4
4
|
* A Turndown plugin which adds a custom rule for paragraphs. This custom rule is required to avoid
|
|
5
|
-
* adding unnecessary blank lines between paragraphs to plain-text documents
|
|
5
|
+
* adding unnecessary blank lines between paragraphs to plain-text documents, and to list items in
|
|
6
|
+
* rich-text documents.
|
|
6
7
|
*
|
|
7
8
|
* @param nodeType The node object that matches this rule.
|
|
8
9
|
* @param isPlainText Specifies if the schema represents a plain-text document.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paragraph.d.ts","sourceRoot":"","sources":["../../../../src/serializers/markdown/plugins/paragraph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAA;AAEpC
|
|
1
|
+
{"version":3,"file":"paragraph.d.ts","sourceRoot":"","sources":["../../../../src/serializers/markdown/plugins/paragraph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAA;AAEpC;;;;;;;GAOG;AACH,iBAAS,SAAS,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,OAAO,GAAG,QAAQ,CAAC,MAAM,CAe5E;AAED,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* A Turndown plugin which adds a custom rule for paragraphs. This custom rule is required to avoid
|
|
3
|
-
* adding unnecessary blank lines between paragraphs to plain-text documents
|
|
3
|
+
* adding unnecessary blank lines between paragraphs to plain-text documents, and to list items in
|
|
4
|
+
* rich-text documents.
|
|
4
5
|
*
|
|
5
6
|
* @param nodeType The node object that matches this rule.
|
|
6
7
|
* @param isPlainText Specifies if the schema represents a plain-text document.
|
|
@@ -9,8 +10,12 @@ function paragraph(nodeType, isPlainText) {
|
|
|
9
10
|
return (turndown) => {
|
|
10
11
|
turndown.addRule(nodeType.name, {
|
|
11
12
|
filter: 'p',
|
|
12
|
-
replacement(content) {
|
|
13
|
-
|
|
13
|
+
replacement(content, node) {
|
|
14
|
+
const useSingleLineSpacing = isPlainText ||
|
|
15
|
+
// Paragraphs within list items should be wrapped with a single line feed to
|
|
16
|
+
// maintain proper list formatting in rich-text documents.
|
|
17
|
+
(!isPlainText && node.parentNode?.nodeName === 'LI');
|
|
18
|
+
return useSingleLineSpacing ? `\n${content}\n` : `\n\n${content}\n\n`;
|
|
14
19
|
},
|
|
15
20
|
});
|
|
16
21
|
};
|
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.
|
|
4
|
+
"version": "4.0.5",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://typist.doist.dev/",
|
|
7
7
|
"repository": "https://github.com/Doist/typist",
|
|
@@ -83,7 +83,6 @@
|
|
|
83
83
|
"@doist/prettier-config": "4.0.0",
|
|
84
84
|
"@doist/reactist": "23.2.0",
|
|
85
85
|
"@mdx-js/react": "3.0.1",
|
|
86
|
-
"@rollup/rollup-linux-x64-gnu": "4.12.0",
|
|
87
86
|
"@semantic-release/changelog": "6.0.3",
|
|
88
87
|
"@semantic-release/exec": "6.0.3",
|
|
89
88
|
"@semantic-release/git": "10.0.1",
|
|
@@ -134,9 +133,9 @@
|
|
|
134
133
|
"remark-gfm": "4.0.0",
|
|
135
134
|
"rimraf": "5.0.5",
|
|
136
135
|
"semantic-release": "23.0.2",
|
|
137
|
-
"tippy.js": "6.3.7",
|
|
138
136
|
"storybook": "7.6.17",
|
|
139
137
|
"storybook-css-modules": "1.0.8",
|
|
138
|
+
"tippy.js": "6.3.7",
|
|
140
139
|
"type-fest": "4.10.3",
|
|
141
140
|
"typescript": "5.3.3",
|
|
142
141
|
"typescript-plugin-css-modules": "5.1.0",
|