joplin-plugin-copy-as-html 1.0.19 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 bwat47
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -13,56 +13,91 @@ The primary use case is copying text from Joplin and pasting formatted text into
13
13
 
14
14
  This will populate the clipboard's text/html category with the HTML formatted text.
15
15
 
16
- > [!note]
17
- > By design, the plugin only copies an HTML fragment including the basic semantic HTML markup (i.e. it won't include any of the Joplin theme styling). This is for maximum compatibility with pasting into other apps, so you don't see issues such as Joplin's background color being pasted- you'll just get the formatted text (bold, italics, formatted lists, etc...).
18
-
19
16
  ### Embed images as base64
20
17
 
21
18
  By default, the plugin will embed any images as base64 in the text/html output, allowing you paste text + images into external applications. However, this can be disabled in the plugin's settings.
22
19
 
23
20
  This should work with both markdown image embeds and the html `<img>` embeds that you get when resizing images via joplin's rich text editor.
24
21
 
22
+ ### Export as fragment or full HTML document
23
+
24
+ When you copy text from Joplin's markdown viewer (or export the note to HTML), there is a lot of styling applied which can sometimes cause issues pasting text into other editors (e.g. if you copy from the markdown viewer, your joplin theme's background color may be pasted).
25
+
26
+ #### HTML Fragment
27
+
28
+ By default, the plugin will populate the clipboard with an HTML fragment, e.g:
29
+
30
+ ```html
31
+ <html>
32
+ <body>
33
+ <!--StartFragment-->
34
+ <h2>Test Heading</h2>
35
+ <p>Test paragraph 1</p>
36
+ <p>Test paragraph 2</p>
37
+ <!--EndFragment-->
38
+ </body>
39
+ </html>
40
+ ```
41
+
42
+ This is similar to what you get when copying from Joplin's TinyMCE rich text editor (semantic markup, no css styling). Any styling will be determined by the application you're pasting the text into.
43
+
44
+ #### Full HTML Document
45
+
46
+ Optionally, you can enable the setting "Export as full HTML document".
47
+
48
+ This will wrap the HTML fragment in a full HTML document with CSS styling. A default (minimal) css [stylesheet](https://github.com/bwat47/joplin-copy-as-html/blob/main/src/defaultStylesheet.ts) is provided. The default stylesheet is only used if no custom stylesheet is provided and the "Export as full HTML document" setting is enabled.
49
+
50
+ To use your own stylesheet, create a file called `copy-as-html-user.css` in your Joplin profile directory. To locate your Joplin profile directory, open Joplin and click Help | Open profile directory.
51
+
25
52
  ### Optional markdown syntax
26
53
 
27
54
  The plugin will adhere to Joplin's settings for whether or not to render:
28
55
 
29
56
  - Soft Breaks
30
- - `^sup^`
31
- - `~sub~`
32
- - `==mark==`
57
+ - Typographer
58
+ - Linkify
59
+ - ==mark==
60
+ - Footnotes
61
+ - Table of Contents
62
+ - ~sub~
63
+ - ^sup^
64
+ - Deflist
65
+ - Abbreviation
66
+ - Markdown Emoji
67
+ - ++Insert++
68
+ - Multimarkdown Table
33
69
 
34
70
  ## Copy as Plain Text
35
71
 
36
72
  "Copy selection as Plain Text" is provided as a right click context menu option and as a keyboard shortcut (ctrl + alt + c by default).
37
73
 
38
- This will strip markdown formatting characters, backslash escapes, and image embeds (e.g. `![](:/22cce3a8c2244493877c66c9e3259274)` or `<img src=":/5bb1066cec6f4c849cefc28ba7b0fc1e">`) from the source markdown and populate it as text/plain in the clipboard, for scenarios where you need to paste into an app that supports neither HTML formatting or markdown.
74
+ This will strip markdown formatting characters, backslash escapes, and image embeds from the source markdown and populate it as text/plain in the clipboard, for scenarios where you need to paste into an app that supports neither HTML formatting or markdown.
39
75
 
40
76
  List leaders and nested list indentation will be maintained (these are normally lost when copying from the markdown viewer or rich text editor).
41
77
 
78
+ ### Customizing plain text output
79
+
42
80
  The following options are provided to preserve specific markdown formatting in the text/plain output:
43
81
 
44
82
  - Preserve superscript characters `(^TEST^)`
45
- If enabled, `^TEST^` will remain `^TEST^` in plain text output.
46
83
 
47
84
  - Preserve subscript characters `(~TEST~)`
48
- If enabled, `~TEST~` will remain `~TEST~` in plain text output.
49
85
 
50
86
  - Preserve emphasis characters `(*TEST* or _TEST_)`
51
- If enabled, `*TEST*` or `_TEST_` will remain as-is in plain text output.
52
87
 
53
88
  - Preserve bold characters `(**TEST** or __TEST__)`
54
- If enabled, `**TEST*`* or `__TEST__` will remain as-is in plain text output.
55
89
 
56
90
  - Preserve heading characters `(## TEST)`
57
- If enabled, `## TEST` will remain as-is in plain text output.
58
91
 
59
- - Preserve ==mark== in plain text
60
- If enabled, `==mark==` will remain as-is in plain text output.
92
+ - Preserve strikethrough characters (`~~TEST~~`)
61
93
 
62
- - Preserve ++insert++ in plain text
63
- If enabled, `++insert++` will remain as-is in plain text output.
94
+ - Preserve horizontal rule (`---`)
64
95
 
65
- As of version 1.0.15, the following options are provided for external hyperlinks (only impacts markdown links containing http/https URL):
96
+ - Preserve highlight characters `(==TEST==)`
97
+
98
+ - Preserve insert characters `(++TEST++)`
99
+
100
+ The following options are provided for external hyperlinks (only impacts markdown links containing http/https URL):
66
101
 
67
102
  - Title - Displays link title only (default).
68
103
 
@@ -70,9 +105,14 @@ As of version 1.0.15, the following options are provided for external hyperlinks
70
105
 
71
106
  - Markdown Format - Displays full markdown link formatting with title and URL.
72
107
 
108
+ ### Markdown emoji
109
+
110
+ Copy as Plain Text supports the markdown-it emoji plugin, so emoji such as :white_check_mark: will be displayed in the plain text output. This can be disabled if desired via the Display emojis setting.
111
+
73
112
  ## Known Issues
74
113
 
75
114
  - The context menu options appear in the rich text editor's context menu (but aren't functional, the plugin is only intended for the markdown editor).
115
+ - The plugin's keyboard shortcuts sometimes don't work on cold start of Joplin, can be fixed by toggling editors or going to Tools | Options | Keyboard Shortcuts and back.
76
116
 
77
117
  ## Misc
78
118
 
package/package.json CHANGED
@@ -1,37 +1,57 @@
1
1
  {
2
- "name": "joplin-plugin-copy-as-html",
3
- "version": "1.0.19",
4
- "scripts": {
5
- "dist": "webpack --env joplin-plugin-config=buildMain && webpack --env joplin-plugin-config=buildExtraScripts && webpack --env joplin-plugin-config=createArchive",
6
- "prepare": "npm run dist",
7
- "updateVersion": "webpack --env joplin-plugin-config=updateVersion",
8
- "update": "npm install -g generator-joplin && yo joplin --node-package-manager npm --update --force"
9
- },
10
- "license": "MIT",
11
- "keywords": [
12
- "joplin-plugin"
13
- ],
14
- "files": [
15
- "publish"
16
- ],
17
- "devDependencies": {
18
- "@types/jsdom": "^21.1.7",
19
- "@types/markdown-it": "^14.1.2",
20
- "@types/node": "^18.7.13",
21
- "chalk": "^4.1.0",
22
- "copy-webpack-plugin": "^11.0.0",
23
- "fs-extra": "^10.1.0",
24
- "glob": "^8.0.3",
25
- "tar": "^6.1.11",
26
- "ts-loader": "^9.3.1",
27
- "typescript": "^4.8.2",
28
- "webpack": "^5.74.0",
29
- "webpack-cli": "^4.10.0"
30
- },
31
- "dependencies": {
32
- "@joplin/renderer": "^3.3.1",
33
- "jsdom": "^26.1.0",
34
- "markdown-it-ins": "^4.0.0",
35
- "markdown-it-mark": "^4.0.0"
36
- }
2
+ "name": "joplin-plugin-copy-as-html",
3
+ "version": "1.1.1",
4
+ "scripts": {
5
+ "dist": "webpack --env joplin-plugin-config=buildMain && webpack --env joplin-plugin-config=buildExtraScripts && webpack --env joplin-plugin-config=createArchive",
6
+ "prepare": "npm run dist",
7
+ "updateVersion": "webpack --env joplin-plugin-config=updateVersion",
8
+ "update": "npm install -g generator-joplin && yo joplin --node-package-manager npm --update --force",
9
+ "lint": "eslint --ext .ts src/",
10
+ "lint:fix": "eslint --ext .ts src/ --fix",
11
+ "format": "prettier --write \"src/**/*.ts\""
12
+ },
13
+ "license": "MIT",
14
+ "keywords": [
15
+ "joplin-plugin"
16
+ ],
17
+ "files": [
18
+ "publish"
19
+ ],
20
+ "devDependencies": {
21
+ "@types/jsdom": "^21.1.7",
22
+ "@types/markdown-it": "^14.1.2",
23
+ "@types/node": "^18.7.13",
24
+ "@typescript-eslint/eslint-plugin": "^8.40.0",
25
+ "@typescript-eslint/parser": "^8.40.0",
26
+ "chalk": "^4.1.0",
27
+ "copy-webpack-plugin": "^11.0.0",
28
+ "eslint": "^9.33.0",
29
+ "eslint-config-prettier": "^10.1.8",
30
+ "eslint-plugin-prettier": "^5.5.4",
31
+ "fs-extra": "^10.1.0",
32
+ "glob": "^8.0.3",
33
+ "prettier": "^3.6.2",
34
+ "tar": "^6.1.11",
35
+ "ts-loader": "^9.3.1",
36
+ "typescript": "^4.8.2",
37
+ "webpack": "^5.74.0",
38
+ "webpack-cli": "^4.10.0"
39
+ },
40
+ "dependencies": {
41
+ "@joplin/renderer": "^3.3.1",
42
+ "jsdom": "^26.1.0",
43
+ "markdown-it": "^14.1.0",
44
+ "markdown-it-abbr": "^2.0.0",
45
+ "markdown-it-deflist": "^3.0.0",
46
+ "markdown-it-emoji": "^3.0.0",
47
+ "markdown-it-footnote": "^4.0.0",
48
+ "markdown-it-ins": "^4.0.0",
49
+ "markdown-it-mark": "^4.0.0",
50
+ "markdown-it-multimd-table": "^4.2.3",
51
+ "markdown-it-sub": "^2.0.0",
52
+ "markdown-it-sup": "^2.0.0",
53
+ "markdown-it-task-lists": "^2.1.1",
54
+ "markdown-it-toc-done-right": "^4.2.0",
55
+ "string-width": "^7.2.0"
56
+ }
37
57
  }
Binary file
@@ -2,16 +2,18 @@
2
2
  "manifest_version": 1,
3
3
  "id": "com.bwat47.copyashtml",
4
4
  "app_min_version": "3.3",
5
- "version": "1.0.19",
5
+ "version": "1.1.1",
6
6
  "name": "Copy as HTML",
7
- "description": "Allows you to copy text with HTML (rich text) formatting from the markdown editor without excess styling.",
7
+ "description": "Allows you to copy text with HTML (rich text) formatting from the markdown editor (including images). Also allows you to copy as plain text (without markdown formatting)",
8
8
  "author": "bwat47",
9
9
  "homepage_url": "https://github.com/bwat47/joplin-copy-as-html",
10
10
  "repository_url": "https://github.com/bwat47/joplin-copy-as-html",
11
11
  "keywords": [
12
12
  "Copy",
13
13
  "HTML",
14
- "Text"
14
+ "Text",
15
+ "Images",
16
+ "Image"
15
17
  ],
16
18
  "categories": [
17
19
  "productivity"
@@ -52,6 +54,12 @@
52
54
  "description": "If enabled, images in selection will be embedded as base64.",
53
55
  "value": true
54
56
  },
57
+ "exportFullHtml": {
58
+ "type": "bool",
59
+ "label": "Export as full HTML document",
60
+ "description": "If enabled, exported HTML will be a full document with your custom stylesheet (copy-as-html-user.css in your profile folder).",
61
+ "value": false
62
+ },
55
63
  "preserveSuperscript": {
56
64
  "type": "bool",
57
65
  "label": "Preserve superscript characters (^TEST^)",
@@ -82,18 +90,36 @@
82
90
  "description": "If enabled, ## TEST will remain as-is in plain text output.",
83
91
  "value": false
84
92
  },
93
+ "preserveStrikethrough": {
94
+ "type": "bool",
95
+ "label": "Preserve strikethrough characters (~~TEST~~)",
96
+ "description": "If enabled, ~~TEST~~ will remain as-is in plain text output.",
97
+ "value": false
98
+ },
99
+ "preserveHorizontalRule": {
100
+ "type": "bool",
101
+ "label": "Preserve horizontal rule (---)",
102
+ "description": "If enabled, horizontal rules will be preserved as --- in plain text output.",
103
+ "value": false
104
+ },
85
105
  "preserveMark": {
86
106
  "type": "bool",
87
- "label": "Preserve ==mark== in plain text",
88
- "description": "If enabled, ==mark== will remain as-is in plain text output.",
107
+ "label": "Preserve highlight characters (==TEST==)",
108
+ "description": "If enabled, ==TEST== will remain as-is in plain text output.",
89
109
  "value": false
90
110
  },
91
111
  "preserveInsert": {
92
112
  "type": "bool",
93
- "label": "Preserve ++insert++ in plain text",
94
- "description": "If enabled, ++insert++ will remain as-is in plain text output.",
113
+ "label": "Preserve insert characters (++TEST++)",
114
+ "description": "If enabled, ++TEST++ will remain as-is in plain text output.",
95
115
  "value": false
96
116
  },
117
+ "displayEmojis": {
118
+ "type": "bool",
119
+ "label": "Display emojis",
120
+ "description": "If enabled, emojis will be displayed in the plain text output.",
121
+ "value": true
122
+ },
97
123
  "hyperlinkBehavior": {
98
124
  "type": "enum",
99
125
  "label": "Plain Text hyperlink behavior",
@@ -104,8 +130,18 @@
104
130
  "markdown": "Markdown Format"
105
131
  },
106
132
  "value": "title"
133
+ },
134
+ "indentType": {
135
+ "type": "enum",
136
+ "label": "List indentation type",
137
+ "description": "How nested lists should be indented in plain text output.",
138
+ "options": {
139
+ "spaces": "4 Spaces",
140
+ "tabs": "Tabs"
141
+ },
142
+ "value": "spaces"
107
143
  }
108
144
  },
109
- "_publish_hash": "sha256:023771699b66cc878919f677d9e90e8935b8ef4dde19aae57ac87605f86f80ef",
110
- "_publish_commit": "main:49808cae45b39fdd338a74c9c487a203ad197b89"
145
+ "_publish_hash": "sha256:2ffd05e7084ce7f3a8852ffd14988f2a8387e0362aad1fecb6188aff48143e05",
146
+ "_publish_commit": "main:2567bcf100f66f40c311db421399fdf6064eaf0a"
111
147
  }