mirror of
https://github.com/zadam/trilium.git
synced 2025-01-19 13:37:58 +08:00
fix pasting HTML content into subnotes
This commit is contained in:
parent
492fde6f46
commit
8b41c1ef31
1 changed files with 2 additions and 2 deletions
|
@ -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…
Reference in a new issue