Skip to content

Commit d739fd8

Browse files
author
Offerel
committed
- Fix for pasting html/markdown
1 parent ef9313f commit d739fd8

File tree

5 files changed

+12
-8
lines changed

5 files changed

+12
-8
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### v2.1.1
2+
- Fix for pasting html/markdown
3+
14
### v2.1.0
25
- Rewrite of most parts
36
- Added markdown linebreak in YAML

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
"name": "offerel/primitivenotes",
33
"description": "A deadly simple notes plugin for Roundcube",
44
"keywords": ["notes","plugin","html","markdown","images","pdf","roundcube"],
5-
"homepage": "https://github.com/Offerel/roundcube_primitivenotes",
5+
"homepage": "https://codeberg.org/Offerel/roundcube_primitivenotes",
66
"type": "roundcube-plugin",
77
"license": "AGPL-3.0",
8-
"version": "2.1.0",
8+
"version": "2.1.1",
99
"authors": [
1010
{
1111
"name": "Offerel",
12-
"homepage": "https://github.com/Offerel",
12+
"homepage": "https://codeberg.org/Offerel",
1313
"role": "Developer"
1414
}
1515
],

js/primitivenotes.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* Roundcube Notes Plugin
33
*
4-
* @version 2.1.0
4+
* @version 2.1.1
55
* @author Offerel
66
* @copyright Copyright (c) 2022, Offerel
77
* @license GNU General Public License, version 3
@@ -212,6 +212,7 @@ function pasteParse(event) {
212212
event.stopPropagation();
213213

214214
const pastedString = event.clipboardData.getData('text/html') || event.clipboardData.getData('text/plain');
215+
console.log(pastedString);
215216

216217
for (var i = 0; i < event.clipboardData.items.length ; i++) {
217218
let item = event.clipboardData.items[i];
@@ -284,7 +285,7 @@ function pasteParse(event) {
284285
}
285286
});
286287

287-
let markdownString = pastedString.startsWith('<html>') ? turndownService.turndown(pastedString) : pastedString;
288+
let markdownString = pastedString.startsWith('<') ? turndownService.turndown(pastedString) : pastedString;
288289

289290
if(markdownString.startsWith('---')) {
290291
let mdArr = markdownString.split('\n');

0 commit comments

Comments
 (0)