tiptap-markdown
Advanced tools
Comparing version 0.4.1 to 0.5.0
@@ -581,2 +581,5 @@ 'use strict'; | ||
} | ||
function escapeHTML(value) { | ||
return value === null || value === void 0 ? void 0 : value.replace(/</g, '<').replace(/>/g, '>'); | ||
} | ||
function extractElement(node) { | ||
@@ -1042,3 +1045,5 @@ var parent = node.parentElement; | ||
var Text$1 = createMarkdownExtension(Text, { | ||
serialize: prosemirrorMarkdown.defaultMarkdownSerializer.nodes.text, | ||
serialize: function serialize(state, node) { | ||
state.text(escapeHTML(node.text)); | ||
}, | ||
parse: {// handled by markdown-it | ||
@@ -1045,0 +1050,0 @@ } |
@@ -572,2 +572,5 @@ import { MarkdownSerializerState as MarkdownSerializerState$1, defaultMarkdownSerializer } from 'prosemirror-markdown'; | ||
} | ||
function escapeHTML(value) { | ||
return value === null || value === void 0 ? void 0 : value.replace(/</g, '<').replace(/>/g, '>'); | ||
} | ||
function extractElement(node) { | ||
@@ -1033,3 +1036,5 @@ var parent = node.parentElement; | ||
var Text$1 = createMarkdownExtension(Text, { | ||
serialize: defaultMarkdownSerializer.nodes.text, | ||
serialize: function serialize(state, node) { | ||
state.text(escapeHTML(node.text)); | ||
}, | ||
parse: {// handled by markdown-it | ||
@@ -1036,0 +1041,0 @@ } |
@@ -577,2 +577,5 @@ (function (global, factory) { | ||
} | ||
function escapeHTML(value) { | ||
return value === null || value === void 0 ? void 0 : value.replace(/</g, '<').replace(/>/g, '>'); | ||
} | ||
function extractElement(node) { | ||
@@ -1038,3 +1041,5 @@ var parent = node.parentElement; | ||
var Text$1 = createMarkdownExtension(Text, { | ||
serialize: prosemirrorMarkdown.defaultMarkdownSerializer.nodes.text, | ||
serialize: function serialize(state, node) { | ||
state.text(escapeHTML(node.text)); | ||
}, | ||
parse: {// handled by markdown-it | ||
@@ -1041,0 +1046,0 @@ } |
{ | ||
"name": "tiptap-markdown", | ||
"version": "0.4.1", | ||
"version": "0.5.0", | ||
"description": "Edit markdown content in tiptap editor.", | ||
@@ -31,3 +31,3 @@ "scripts": { | ||
"markdown-it-task-lists": "^2.1.1", | ||
"prosemirror-markdown": "^1.6.0" | ||
"prosemirror-markdown": "^1.8.0" | ||
}, | ||
@@ -34,0 +34,0 @@ "devDependencies": { |
import { Node } from "@tiptap/core"; | ||
import { defaultMarkdownSerializer } from "prosemirror-markdown"; | ||
import { createMarkdownExtension } from "../../util/extensions"; | ||
import { escapeHTML } from "../../util/dom"; | ||
@@ -11,3 +11,5 @@ | ||
export default createMarkdownExtension(Text, { | ||
serialize: defaultMarkdownSerializer.nodes.text, | ||
serialize(state, node) { | ||
state.text(escapeHTML(node.text)); | ||
}, | ||
parse: { | ||
@@ -14,0 +16,0 @@ // handled by markdown-it |
@@ -10,2 +10,8 @@ | ||
export function escapeHTML(value) { | ||
return value | ||
?.replace(/</g, '<') | ||
.replace(/>/g, '>'); | ||
} | ||
export function extractElement(node) { | ||
@@ -12,0 +18,0 @@ const parent = node.parentElement; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
333680
4105
Updatedprosemirror-markdown@^1.8.0