tiptap-markdown
Advanced tools
Comparing version 0.3.0 to 0.3.1
@@ -649,3 +649,3 @@ 'use strict'; | ||
var element = dom.firstElementChild; | ||
element.innerHTML = "\n".concat(element.innerHTML, "\n"); | ||
element.innerHTML = element.innerHTML.trim() ? "\n".concat(element.innerHTML, "\n") : "\n"; | ||
return element.outerHTML; | ||
@@ -775,5 +775,5 @@ } | ||
var html = options.html, | ||
linkify = options.linkify; | ||
options.languageClassPrefix; | ||
var inline = options.inline; | ||
linkify = options.linkify, | ||
inline = options.inline, | ||
breaks = options.breaks; | ||
@@ -783,3 +783,4 @@ if (typeof content === 'string') { | ||
html: html, | ||
linkify: linkify | ||
linkify: linkify, | ||
breaks: breaks | ||
}); | ||
@@ -1147,3 +1148,4 @@ extensions.forEach(function (extension) { | ||
bulletListMarker: '-', | ||
linkify: false | ||
linkify: false, | ||
breaks: false | ||
}; | ||
@@ -1216,12 +1218,10 @@ function createMarkdownEditor(Editor) { | ||
html = _this$options$markdow2.html, | ||
linkify = _this$options$markdow2.linkify; | ||
var codeBlockNode = this.options.extensions.find(function (extension) { | ||
return extension.type === 'node' && extension.name === 'codeBlock'; | ||
}); | ||
linkify = _this$options$markdow2.linkify, | ||
breaks = _this$options$markdow2.breaks; | ||
return parse(this.schema, content, { | ||
extensions: this.markdownExtensions, | ||
languageClassPrefix: codeBlockNode === null || codeBlockNode === void 0 ? void 0 : codeBlockNode.options.languageClassPrefix, | ||
html: html, | ||
linkify: linkify, | ||
inline: inline | ||
inline: inline, | ||
breaks: breaks | ||
}); | ||
@@ -1228,0 +1228,0 @@ } |
@@ -639,3 +639,3 @@ import { MarkdownSerializerState as MarkdownSerializerState$1, defaultMarkdownSerializer } from 'prosemirror-markdown'; | ||
var element = dom.firstElementChild; | ||
element.innerHTML = "\n".concat(element.innerHTML, "\n"); | ||
element.innerHTML = element.innerHTML.trim() ? "\n".concat(element.innerHTML, "\n") : "\n"; | ||
return element.outerHTML; | ||
@@ -765,5 +765,5 @@ } | ||
var html = options.html, | ||
linkify = options.linkify; | ||
options.languageClassPrefix; | ||
var inline = options.inline; | ||
linkify = options.linkify, | ||
inline = options.inline, | ||
breaks = options.breaks; | ||
@@ -773,3 +773,4 @@ if (typeof content === 'string') { | ||
html: html, | ||
linkify: linkify | ||
linkify: linkify, | ||
breaks: breaks | ||
}); | ||
@@ -1137,3 +1138,4 @@ extensions.forEach(function (extension) { | ||
bulletListMarker: '-', | ||
linkify: false | ||
linkify: false, | ||
breaks: false | ||
}; | ||
@@ -1206,12 +1208,10 @@ function createMarkdownEditor(Editor) { | ||
html = _this$options$markdow2.html, | ||
linkify = _this$options$markdow2.linkify; | ||
var codeBlockNode = this.options.extensions.find(function (extension) { | ||
return extension.type === 'node' && extension.name === 'codeBlock'; | ||
}); | ||
linkify = _this$options$markdow2.linkify, | ||
breaks = _this$options$markdow2.breaks; | ||
return parse(this.schema, content, { | ||
extensions: this.markdownExtensions, | ||
languageClassPrefix: codeBlockNode === null || codeBlockNode === void 0 ? void 0 : codeBlockNode.options.languageClassPrefix, | ||
html: html, | ||
linkify: linkify, | ||
inline: inline | ||
inline: inline, | ||
breaks: breaks | ||
}); | ||
@@ -1218,0 +1218,0 @@ } |
@@ -644,3 +644,3 @@ (function (global, factory) { | ||
var element = dom.firstElementChild; | ||
element.innerHTML = "\n".concat(element.innerHTML, "\n"); | ||
element.innerHTML = element.innerHTML.trim() ? "\n".concat(element.innerHTML, "\n") : "\n"; | ||
return element.outerHTML; | ||
@@ -770,5 +770,5 @@ } | ||
var html = options.html, | ||
linkify = options.linkify; | ||
options.languageClassPrefix; | ||
var inline = options.inline; | ||
linkify = options.linkify, | ||
inline = options.inline, | ||
breaks = options.breaks; | ||
@@ -778,3 +778,4 @@ if (typeof content === 'string') { | ||
html: html, | ||
linkify: linkify | ||
linkify: linkify, | ||
breaks: breaks | ||
}); | ||
@@ -1142,3 +1143,4 @@ extensions.forEach(function (extension) { | ||
bulletListMarker: '-', | ||
linkify: false | ||
linkify: false, | ||
breaks: false | ||
}; | ||
@@ -1211,12 +1213,10 @@ function createMarkdownEditor(Editor) { | ||
html = _this$options$markdow2.html, | ||
linkify = _this$options$markdow2.linkify; | ||
var codeBlockNode = this.options.extensions.find(function (extension) { | ||
return extension.type === 'node' && extension.name === 'codeBlock'; | ||
}); | ||
linkify = _this$options$markdow2.linkify, | ||
breaks = _this$options$markdow2.breaks; | ||
return parse(this.schema, content, { | ||
extensions: this.markdownExtensions, | ||
languageClassPrefix: codeBlockNode === null || codeBlockNode === void 0 ? void 0 : codeBlockNode.options.languageClassPrefix, | ||
html: html, | ||
linkify: linkify, | ||
inline: inline | ||
inline: inline, | ||
breaks: breaks | ||
}); | ||
@@ -1223,0 +1223,0 @@ } |
{ | ||
"name": "tiptap-markdown", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Edit markdown content in tiptap editor.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -45,5 +45,7 @@ import { getHTMLFromFragment, Node } from "@tiptap/core"; | ||
element.innerHTML = `\n${element.innerHTML}\n`; | ||
element.innerHTML = element.innerHTML.trim() | ||
? `\n${element.innerHTML}\n` | ||
: `\n`; | ||
return element.outerHTML; | ||
} |
@@ -13,2 +13,3 @@ import { serialize } from "./serialize"; | ||
linkify: false, | ||
breaks: false, | ||
} | ||
@@ -58,12 +59,10 @@ | ||
parseMarkdown(content, { inline } = {}) { | ||
const { html, linkify } = this.options.markdown; | ||
const codeBlockNode = this.options.extensions | ||
.find(extension => extension.type === 'node' && extension.name === 'codeBlock'); | ||
const { html, linkify, breaks } = this.options.markdown; | ||
return parse(this.schema, content, { | ||
extensions: this.markdownExtensions, | ||
languageClassPrefix: codeBlockNode?.options.languageClassPrefix, | ||
html, | ||
linkify, | ||
inline, | ||
breaks, | ||
}); | ||
@@ -70,0 +69,0 @@ } |
@@ -9,4 +9,4 @@ import markdownit from "markdown-it"; | ||
linkify, | ||
languageClassPrefix, | ||
inline, | ||
breaks, | ||
} = options; | ||
@@ -18,2 +18,3 @@ | ||
linkify, | ||
breaks, | ||
}); | ||
@@ -20,0 +21,0 @@ |
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
4013
323295