joplin-plugin-codeblock-autocomplete 1.3.1 → 1.5.0

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 CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 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
1
+ MIT License
2
+
3
+ Copyright (c) 2026 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
21
  SOFTWARE.
package/README.md CHANGED
@@ -3,9 +3,10 @@
3
3
 
4
4
  # Codeblock Autocomplete
5
5
 
6
- Provides auto-complete when creating fenced code blocks by typing backticks/tildes in the markdown editor, plus a few other utilities:
6
+ Provides auto-complete when creating fenced code blocks by typing backticks/tildes in the Markdown editor, plus a few additional code block features:
7
7
 
8
- - Copy button for code blocks in the markdown editor
8
+ - Copy button for code blocks in the Markdown editor
9
+ - Copy button for fenced code blocks in the Markdown viewer (and Rich Text editor)
9
10
  - Toolbar button/Editor command to insert new code block or wrap existing text in a code block
10
11
 
11
12
  Codemirror 6 only, legacy editor is not supported.
@@ -28,18 +29,31 @@ Typing an opening fence (three+ backticks or three+ tildes) will trigger the aut
28
29
 
29
30
  An insert code block command is available via a formatting toolbar icon, Edit menu entry, and keyboard shortcut (by default CmdOrCtrl + Alt + `).
30
31
 
31
- The command supports multiple cursors and selections, and is line-aware (e.g. cursor on line with no selection > invoke command > wraps entire line in code block).
32
+ The command supports multiple cursors and selections, and is line-aware (e.g. cursor on line with no selection > invoke command > wraps entire line in code block). Invoking it with a cursor or selection inside an existing fenced code block removes the surrounding fence lines.
32
33
 
33
- ### Copy button
34
+ ### Markdown editor copy button
34
35
 
35
36
  If the copy widget is enabled, you will see the code fence language rendered as a clickable copy button on the top-right of the code block (when the cursor isn't on the opening fence line).
36
37
 
37
38
  Clicking the copy button will copy the code block contents to your clipboard. If the code fence doesn't have a language specified, it will display a generic "Copy" label instead of the language.
38
39
 
40
+ ### Markdown viewer copy button
41
+
42
+ The Markdown viewer has a separate copy-widget setting. When enabled, hovering over a rendered fenced code block shows an icon-only copy button in its top-right corner. The button remains visible on touch devices and can also be reached with the keyboard.
43
+
44
+ Clicking the button copies the fenced code contents and displays a success toast. Indented code blocks, inline code, raw HTML code blocks, and fences that Joplin renders as something other than code (Mermaid, ABC notation, Fountain) are not changed.
45
+
46
+ > [!note]
47
+ > This setting also enables a working copy button in the desktop rich text editor (TinyMCE).
48
+ >
49
+ > It technically works in the mobile (prosemirror) rich text editor as well, however, the prosemirror editor places its own "edit" button on the top right, so the two buttons overlap.
50
+
39
51
  ## Settings
40
52
 
41
53
  Enable language auto-complete - Toggle the language dropdown for code fences. When disabled, typing exactly three backticks or tildes inserts a closing fence immediately without opening the dropdown.
42
54
 
43
55
  Autocomplete languages - Comma-separated list of language identifiers to show in the autocomplete menu.
44
56
 
45
- Enable code block copy widget - Show a copy button on fenced code blocks in the Markdown editor and hide the opening-fence language text when the cursor is not on that line.
57
+ Enable Markdown editor copy widget - Show a copy button on fenced code blocks in the Markdown editor and hide the opening-fence language text when the cursor is not on that line.
58
+
59
+ Enable Markdown viewer copy widget - Show a copy button when hovering over fenced code blocks in the Markdown viewer.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "joplin-plugin-codeblock-autocomplete",
3
- "version": "1.3.1",
3
+ "version": "1.5.0",
4
4
  "scripts": {
5
5
  "dist": "webpack --env joplin-plugin-config=buildMain && webpack --env joplin-plugin-config=buildExtraScripts && webpack --env joplin-plugin-config=createArchive",
6
6
  "prepare": "npm run dist",
@@ -9,8 +9,9 @@
9
9
  "lint": "eslint --ext .ts src/",
10
10
  "lint:fix": "eslint --ext .ts src/ --fix",
11
11
  "format": "prettier --write \"src/**/*.ts\"",
12
- "test": "jest --passWithNoTests",
13
- "test:watch": "jest --watch"
12
+ "test": "vitest run --passWithNoTests",
13
+ "test:watch": "vitest --passWithNoTests",
14
+ "knip": "knip"
14
15
  },
15
16
  "license": "MIT",
16
17
  "keywords": [
@@ -21,30 +22,31 @@
21
22
  ],
22
23
  "devDependencies": {
23
24
  "@codemirror/autocomplete": "^6.20.0",
25
+ "@codemirror/lang-markdown": "^6.5.0",
26
+ "@codemirror/language": "^6.12.4",
24
27
  "@codemirror/state": "^6.5.4",
25
28
  "@codemirror/view": "^6.35.0",
26
- "@codemirror/lang-markdown": "^6.5.0",
27
- "@eslint/eslintrc": "^3.3.5",
28
29
  "@eslint/js": "^10.0.1",
29
- "@types/jest": "^30.0.0",
30
- "@types/node": "^24.10.1",
31
- "@typescript-eslint/eslint-plugin": "^8.58.0",
32
- "@typescript-eslint/parser": "^8.58.0",
30
+ "@lezer/common": "^1.5.2",
31
+ "@types/node": "^24.13.2",
32
+ "@typescript-eslint/eslint-plugin": "^8.66.0",
33
+ "@typescript-eslint/parser": "^8.66.0",
33
34
  "chalk": "^4.1.0",
34
35
  "copy-webpack-plugin": "^14.0.0",
35
- "eslint": "^10.1.0",
36
+ "eslint": "^10.8.1",
36
37
  "eslint-config-prettier": "^10.1.8",
37
38
  "eslint-plugin-import-x": "^4.16.2",
38
- "eslint-plugin-prettier": "^5.5.5",
39
+ "eslint-plugin-sonarjs": "^4.2.0",
39
40
  "fs-extra": "^10.1.0",
40
41
  "glob": "^8.0.3",
41
- "jest": "^30.3.0",
42
- "jest-environment-jsdom": "^30.3.0",
42
+ "globals": "^17.7.0",
43
+ "jsdom": "^29.1.1",
44
+ "knip": "^6.24.0",
43
45
  "prettier": "^3.6.2",
44
46
  "tar": "^7.5.12",
45
- "ts-jest": "^29.4.9",
46
47
  "ts-loader": "^9.3.1",
47
48
  "typescript": "^6.0.3",
49
+ "vitest": "^4.1.10",
48
50
  "webpack": "^5.105.4",
49
51
  "webpack-cli": "^6.0.1"
50
52
  }
@@ -2,13 +2,13 @@
2
2
  "manifest_version": 1,
3
3
  "id": "com.bwat47.codeblock-autocomplete",
4
4
  "app_min_version": "3.3",
5
- "version": "1.3.1",
5
+ "version": "1.5.0",
6
6
  "platforms": [
7
7
  "desktop",
8
8
  "mobile"
9
9
  ],
10
10
  "name": "Codeblock Autocomplete",
11
- "description": "Code block utilities for the markdown editor: auto-completes fenced code, copy button for code blocks, toolbar button/editor command to create code blocks",
11
+ "description": "Code block utilities for the Markdown editor and viewer: fenced-code autocomplete and copy buttons, plus a command to create code blocks",
12
12
  "author": "bwat47",
13
13
  "homepage_url": "https://github.com/bwat47/joplin-codeblock-autocomplete",
14
14
  "repository_url": "https://github.com/bwat47/joplin-codeblock-autocomplete",
@@ -25,12 +25,21 @@
25
25
  "categories": [
26
26
  "productivity",
27
27
  "developer tools",
28
- "editor"
28
+ "editor",
29
+ "viewer"
29
30
  ],
30
31
  "screenshots": [
31
32
  {
32
33
  "src": "images/screenshot1.png",
33
- "label": "Codeblock Autocomplete Screenshot 1"
34
+ "label": "Code autocomplete example"
35
+ },
36
+ {
37
+ "src": "images/screenshot2.png",
38
+ "label": "Markdown editor copy widget example"
39
+ },
40
+ {
41
+ "src": "images/screenshot3.png",
42
+ "label": "Markdown viewer copy widget example"
34
43
  }
35
44
  ],
36
45
  "icons": {
@@ -44,6 +53,6 @@
44
53
  "src": "images/promo.png",
45
54
  "label": "Codeblock Autocomplete Promo Tile"
46
55
  },
47
- "_publish_hash": "sha256:dd329f928d027e30c7a3ddd131f1912688ac5fadab44fbec78e30a534cff5200",
48
- "_publish_commit": "main:eedd0c919ea40d17de727209a328f86a41e1aead"
56
+ "_publish_hash": "sha256:a82ea52d75044a6c0c2d6c04333080552038ce50e38b58c3b22d137de1181873",
57
+ "_publish_commit": "main:99794f2e20173bc346855a8c7a269b7bb77debb7"
49
58
  }