@ctzhian/tiptap 2.6.0 → 2.6.1
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.
|
@@ -22,7 +22,7 @@ export var InlineAttachmentExtension = function InlineAttachmentExtension(props)
|
|
|
22
22
|
url: {
|
|
23
23
|
default: '',
|
|
24
24
|
parseHTML: function parseHTML(element) {
|
|
25
|
-
return withBaseUrl(element.getAttribute('data-url') || '', props.baseUrl);
|
|
25
|
+
return withBaseUrl(element.getAttribute('data-url') || element.getAttribute('href') || '', props.baseUrl);
|
|
26
26
|
},
|
|
27
27
|
renderHTML: function renderHTML(attributes) {
|
|
28
28
|
return {
|
|
@@ -33,7 +33,7 @@ export var InlineAttachmentExtension = function InlineAttachmentExtension(props)
|
|
|
33
33
|
title: {
|
|
34
34
|
default: '',
|
|
35
35
|
parseHTML: function parseHTML(element) {
|
|
36
|
-
return element.getAttribute('data-title');
|
|
36
|
+
return element.getAttribute('data-title') || element.getAttribute('title') || element.getAttribute('aria-label') || element.textContent;
|
|
37
37
|
},
|
|
38
38
|
renderHTML: function renderHTML(attributes) {
|
|
39
39
|
return {
|
|
@@ -154,7 +154,7 @@ export var BlockAttachmentExtension = function BlockAttachmentExtension(props) {
|
|
|
154
154
|
url: {
|
|
155
155
|
default: '',
|
|
156
156
|
parseHTML: function parseHTML(element) {
|
|
157
|
-
return withBaseUrl(element.getAttribute('data-url') || '', props.baseUrl);
|
|
157
|
+
return withBaseUrl(element.getAttribute('data-url') || element.getAttribute('href') || '', props.baseUrl);
|
|
158
158
|
},
|
|
159
159
|
renderHTML: function renderHTML(attributes) {
|
|
160
160
|
if (!attributes.url) return {};
|
|
@@ -166,7 +166,7 @@ export var BlockAttachmentExtension = function BlockAttachmentExtension(props) {
|
|
|
166
166
|
title: {
|
|
167
167
|
default: '',
|
|
168
168
|
parseHTML: function parseHTML(element) {
|
|
169
|
-
return element.getAttribute('data-title');
|
|
169
|
+
return element.getAttribute('data-title') || element.getAttribute('title') || element.getAttribute('aria-label') || element.textContent;
|
|
170
170
|
},
|
|
171
171
|
renderHTML: function renderHTML(attributes) {
|
|
172
172
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ctzhian/tiptap",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"description": "基于 Tiptap 二次开发的编辑器组件",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -94,7 +94,6 @@
|
|
|
94
94
|
"@tiptap/extension-horizontal-rule": "^3.11.1",
|
|
95
95
|
"@tiptap/extension-image": "^3.11.1",
|
|
96
96
|
"@tiptap/extension-invisible-characters": "^3.11.1",
|
|
97
|
-
"@tiptap/extension-link": "^3.11.1",
|
|
98
97
|
"@tiptap/extension-list": "^3.11.1",
|
|
99
98
|
"@tiptap/extension-mathematics": "^3.11.1",
|
|
100
99
|
"@tiptap/extension-mention": "^3.11.1",
|