mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
fix pasting HTML content into subnotes
This commit is contained in:
parent
492fde6f46
commit
8b41c1ef31
@ -530,8 +530,8 @@ function parseSelectedHtml(selectedHtml) {
|
|||||||
|
|
||||||
if (dom.length > 0 && dom[0].tagName && dom[0].tagName.match(/h[1-6]/i)) {
|
if (dom.length > 0 && dom[0].tagName && dom[0].tagName.match(/h[1-6]/i)) {
|
||||||
const title = $(dom[0]).text();
|
const title = $(dom[0]).text();
|
||||||
const domWithoutTitle = dom.slice(1);
|
// remove the title from content (only first occurence)
|
||||||
const content = domWithoutTitle.map(el => $(el).html()).join("");
|
const content = selectedHtml.replace(dom[0].outerHTML, "");
|
||||||
|
|
||||||
return [title, content];
|
return [title, content];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user