Skip to content

Commit fcd70b2

Browse files
committed
Merge branch 'release/3.82.1'
2 parents a8cda9d + e2a9e4e commit fcd70b2

39 files changed

+197
-101
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a new feature or improvement
4+
title: "[Feature]:Feature Name"
5+
labels: 'Feature'
6+
assignees: ''
7+
8+
---
9+
10+
**Feature Description**
11+
Briefly describe the feature and its purpose.
12+
13+
**Background**
14+
Why is this feature needed? Provide some context or business scenario that helps understand the need for this feature.
15+
16+
**Expected Behavior**
17+
Describe how the feature should behave once implemented
18+
19+
**Proposed Solution (Optional)**
20+
If you have a solution or suggestion, briefly explain it here
21+
22+
**Additional Information (Optional)**
23+
Any dependencies or potential impact on other features
24+
25+
**Priority (Optional)**
26+
- [ ] High
27+
- [ ] Medium
28+
- [ ] Low

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,14 @@ For more information on how to use the following functions, please see [characte
7676

7777
## Changelogs
7878

79-
### [v3.81.3](https://github.com/purocean/yn/releases/tag/v3.81.3) 2025-01-27
79+
### [v3.82.1](https://github.com/purocean/yn/releases/tag/v3.82.1) 2025-03-30
8080

81-
[Windows](https://github.com/purocean/yn/releases/download/v3.81.3/Yank-Note-win-x64-3.81.3.exe) | [macOS arm64](https://github.com/purocean/yn/releases/download/v3.81.3/Yank-Note-mac-arm64-3.81.3.dmg) | [macOS x64](https://github.com/purocean/yn/releases/download/v3.81.3/Yank-Note-mac-x64-3.81.3.dmg) | [Linux AppImage](https://github.com/purocean/yn/releases/download/v3.81.3/Yank-Note-linux-x86_64-3.81.3.AppImage) | [Linux deb](https://github.com/purocean/yn/releases/download/v3.81.3/Yank-Note-linux-amd64-3.81.3.deb)
81+
[Windows](https://github.com/purocean/yn/releases/download/v3.82.1/Yank-Note-win-x64-3.82.1.exe) | [macOS arm64](https://github.com/purocean/yn/releases/download/v3.82.1/Yank-Note-mac-arm64-3.82.1.dmg) | [macOS x64](https://github.com/purocean/yn/releases/download/v3.82.1/Yank-Note-mac-x64-3.82.1.dmg) | [Linux AppImage](https://github.com/purocean/yn/releases/download/v3.82.1/Yank-Note-linux-x86_64-3.82.1.AppImage) | [Linux deb](https://github.com/purocean/yn/releases/download/v3.82.1/Yank-Note-linux-amd64-3.82.1.deb)
8282

83-
1. fix: Fix the issue where directories might fail to be deleted on Windows
83+
1. feat: Added font configuration for the preview area
84+
2. feat: Restrict Markdown syntax suggestions in the editor from displaying within code fences
85+
3. fix: Fixed the issue where exported HTML headings were not highlighted correctly in some cases
86+
4. feat(plugin): Added the `ctx.editor.getLineLanguageId` method to retrieve the language ID of a specific line
8487

8588
[More release notes](https://github.com/purocean/yn/releases)
8689

README_ZH-CN.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,14 @@
7676

7777
## 更新日志
7878

79-
### [v3.81.3](https://github.com/purocean/yn/releases/tag/v3.81.3) 2025-01-27
79+
### [v3.82.1](https://github.com/purocean/yn/releases/tag/v3.82.1) 2025-03-30
8080

81-
[Windows](https://github.com/purocean/yn/releases/download/v3.81.3/Yank-Note-win-x64-3.81.3.exe) | [macOS arm64](https://github.com/purocean/yn/releases/download/v3.81.3/Yank-Note-mac-arm64-3.81.3.dmg) | [macOS x64](https://github.com/purocean/yn/releases/download/v3.81.3/Yank-Note-mac-x64-3.81.3.dmg) | [Linux AppImage](https://github.com/purocean/yn/releases/download/v3.81.3/Yank-Note-linux-x86_64-3.81.3.AppImage) | [Linux deb](https://github.com/purocean/yn/releases/download/v3.81.3/Yank-Note-linux-amd64-3.81.3.deb)
81+
[Windows](https://github.com/purocean/yn/releases/download/v3.82.1/Yank-Note-win-x64-3.82.1.exe) | [macOS arm64](https://github.com/purocean/yn/releases/download/v3.82.1/Yank-Note-mac-arm64-3.82.1.dmg) | [macOS x64](https://github.com/purocean/yn/releases/download/v3.82.1/Yank-Note-mac-x64-3.82.1.dmg) | [Linux AppImage](https://github.com/purocean/yn/releases/download/v3.82.1/Yank-Note-linux-x86_64-3.82.1.AppImage) | [Linux deb](https://github.com/purocean/yn/releases/download/v3.82.1/Yank-Note-linux-amd64-3.82.1.deb)
8282

83-
1. fix: 修复 Windows 上可能删除目录失败问题
83+
1. feat: 新增预览区字体配置
84+
2. feat: 限制编辑器的 Markdown 语法建议在代码围栏中不显示
85+
3. fix: 修复某些情况下导出的 HTML 标题高亮不正确问题
86+
4. feat(plugin): 增加 `ctx.editor.getLineLanguageId` 方法获取某行的语言ID
8487

8588
[更多发布说明](https://github.com/purocean/yn/releases)
8689

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "yank.note",
3-
"version": "3.81.3",
3+
"version": "3.82.1",
44
"description": "Yank Note: A highly extensible Markdown editor, designed for productivity.",
55
"main": "dist/main/app.js",
66
"license": "AGPL-3.0",
@@ -137,7 +137,7 @@
137137
"normalize.css": "^8.0.1",
138138
"parse-author": "^2.0.0",
139139
"path-browserify": "^1.0.1",
140-
"prismjs": "^1.29.0",
140+
"prismjs": "^1.30.0",
141141
"sass": "^1.83.0",
142142
"socket.io-client": "^4.7.2",
143143
"sortablejs": "^1.13.0",
@@ -148,7 +148,7 @@
148148
"typescript": "^5.5.4",
149149
"utility-types": "^3.10.0",
150150
"viewerjs": "^1.11.6",
151-
"vite": "^6.0.9",
151+
"vite": "^6.0.12",
152152
"vue": "^3.5.13",
153153
"vue-tsc": "^2.2.0",
154154
"xterm": "^4.18.0",

scripts/download-plantuml.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const path = require('path')
33
const request = require('request')
44

55
const filename = 'plantuml.jar'
6-
const downloadUrl = 'https://github.com/plantuml/plantuml/releases/download/v1.2023.10/plantuml-1.2023.10.jar'
6+
const downloadUrl = 'https://github.com/plantuml/plantuml/releases/download/v1.2025.0/plantuml.jar'
77

88
console.info('Download plantuml', downloadUrl, filename)
99

src/renderer/components/TitleBar.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export default defineComponent({
165165
166166
if (file) {
167167
if (file.repo === HELP_REPO_NAME) {
168-
return file.title
168+
return file.name
169169
}
170170
171171
if (!isSaved.value) {
@@ -210,7 +210,7 @@ export default defineComponent({
210210
})
211211
212212
watch(statusText, () => {
213-
document.title = currentFile.value ? (currentFile.value.name || currentFile.value.title || 'Yank Note') : t('file-status.no-file')
213+
document.title = currentFile.value ? (currentFile.value.name || 'Yank Note') : t('file-status.no-file')
214214
}, { immediate: true })
215215
216216
watch(isSaved, (val: boolean) => {

src/renderer/others/setting-schema.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,15 @@ const schema: SettingSchema = ({
8888
minimum: 10,
8989
maximum: Number.MAX_SAFE_INTEGER,
9090
},
91+
'view.default-previewer-font-family': {
92+
defaultValue: '',
93+
title: 'T_setting-panel.schema.view.default-previewer-font-family',
94+
type: 'string',
95+
group: 'appearance',
96+
options: {
97+
inputAttributes: { placeholder: 'e.g., \'Courier New\', monospace' }
98+
},
99+
},
91100
'updater.source': {
92101
defaultValue: 'auto',
93102
title: 'T_setting-panel.schema.updater.source',

src/renderer/plugins.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ import copyContent from '@fe/plugins/copy-content'
7070
import sharePreview from '@fe/plugins/share-preview'
7171
import codeRunners from '@fe/plugins/code-runners'
7272
import watchFileRefresh from '@fe/plugins/watch-file-refresh'
73-
import previewFontSize from '@fe/plugins/preview-font-size'
73+
import previewFont from '@fe/plugins/preview-font'
7474
import dropToOpenFile from '@fe/plugins/drop-to-open-file'
7575
import recordRecentDocument from '@fe/plugins/record-recent-document'
7676
import aiCopilot from '@fe/plugins/ai-copilot'
@@ -150,7 +150,7 @@ export default [
150150
sharePreview,
151151
codeRunners,
152152
watchFileRefresh,
153-
previewFontSize,
153+
previewFont,
154154
dropToOpenFile,
155155
recordRecentDocument,
156156
markdownGithubAlerts,

src/renderer/plugins/code-runners.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,10 @@ export default {
256256
/* eslint-disable no-template-curly-in-string */
257257

258258
items.push(
259-
{ label: '/ ``` Run Code (JavaScript)', insertText: '```js\n// --run--\n${1:await new Promise(r => setTimeout(r, 500))\nconsole.log("hello world!")}\n```\n', block: true },
260-
{ label: '/ ``` Run Code (JavaScript - No Worker)', insertText: '```js\n// --run-- --no-worker--\n${1:await new Promise(r => setTimeout(r, 500))\nctx.ui.useToast().show("info", "HELLOWORLD!")\nconsole.log("hello world!")}\n```\n', block: true },
261-
{ label: '/ ``` Run Code (Bash)', insertText: '```bash\n# --run--\n${1:echo HELLOWORLD}\n```\n', block: true },
262-
{ label: '/ ``` Run Code (C)', insertText: '```c\n// --run-- gcc \\$tmpFile.c -o \\$tmpFile.out && \\$tmpFile.out\n${1:#include <stdio.h>\n \nint main () {\n printf("Hello, World!");\n return 0;\n}}\n```\n', block: true },
259+
{ language: 'markdown', label: '/ ``` Run Code (JavaScript)', insertText: '```js\n// --run--\n${1:await new Promise(r => setTimeout(r, 500))\nconsole.log("hello world!")}\n```\n', block: true },
260+
{ language: 'markdown', label: '/ ``` Run Code (JavaScript - No Worker)', insertText: '```js\n// --run-- --no-worker--\n${1:await new Promise(r => setTimeout(r, 500))\nctx.ui.useToast().show("info", "HELLOWORLD!")\nconsole.log("hello world!")}\n```\n', block: true },
261+
{ language: 'markdown', label: '/ ``` Run Code (Bash)', insertText: '```bash\n# --run--\n${1:echo HELLOWORLD}\n```\n', block: true },
262+
{ language: 'markdown', label: '/ ``` Run Code (C)', insertText: '```c\n// --run-- gcc \\$tmpFile.c -o \\$tmpFile.out && \\$tmpFile.out\n${1:#include <stdio.h>\n \nint main () {\n printf("Hello, World!");\n return 0;\n}}\n```\n', block: true },
263263
)
264264
})
265265
}

src/renderer/plugins/editor-md-syntax.ts

Lines changed: 36 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,13 @@ class MdSyntaxCompletionProvider implements Monaco.languages.CompletionItemProvi
7676
return 0
7777
}
7878

79-
private async provideSelectionCompletionItems (model: Monaco.editor.IModel, selection: Monaco.Selection): Promise<Monaco.languages.CompletionList | undefined> {
79+
private async provideSelectionCompletionItems (model: Monaco.editor.IModel, selection: Monaco.Selection, languageId: string): Promise<Monaco.languages.CompletionList | undefined> {
8080
const selectionEndLineMaxColumn = model.getLineMaxColumn(selection.endLineNumber)
8181
const items = this.ctx.editor.getSimpleCompletionItems().filter(item => {
82+
if (item.language && item.language !== languageId) {
83+
return false
84+
}
85+
8286
if (item.insertText.includes('${TM_SELECTED_TEXT}')) {
8387
return true
8488
}
@@ -126,9 +130,11 @@ class MdSyntaxCompletionProvider implements Monaco.languages.CompletionItemProvi
126130
}
127131

128132
public async provideCompletionItems (model: Monaco.editor.IModel, position: Monaco.Position): Promise<Monaco.languages.CompletionList | undefined> {
133+
const languageId = this.ctx.editor.getLineLanguageId(position.lineNumber, model)
134+
129135
const selection = this.ctx.editor.getEditor().getSelection()!
130136
if (!selection.isEmpty()) {
131-
return this.provideSelectionCompletionItems(model, selection)
137+
return this.provideSelectionCompletionItems(model, selection, languageId)
132138
}
133139

134140
const line = model.getLineContent(position.lineNumber)
@@ -142,6 +148,10 @@ class MdSyntaxCompletionProvider implements Monaco.languages.CompletionItemProvi
142148
}
143149

144150
const items = this.ctx.editor.getSimpleCompletionItems().filter((item) => {
151+
if (item.language && item.language !== languageId) {
152+
return false
153+
}
154+
145155
return !item.block || startColumn === 1
146156
})
147157

@@ -228,30 +238,30 @@ export default {
228238

229239
ctx.editor.tapSimpleCompletionItems(items => {
230240
items.unshift(
231-
{ label: '/ ![]() Image', insertText: '![${2:Img}]($1)' },
232-
{ label: '/ []() Link', insertText: '[${2:Link}]($1)' },
233-
{ label: '/ # Head 1', insertText: '# $1', block: true },
234-
{ label: '/ ## Head 2', insertText: '## $1', block: true },
235-
{ label: '/ ### Head 3', insertText: '### $1', block: true },
236-
{ label: '/ #### Head 4', insertText: '#### $1', block: true },
237-
{ label: '/ ##### Head 5', insertText: '##### $1', block: true },
238-
{ label: '/ ###### Head 6', insertText: '###### $1', block: true },
239-
{ label: '/ + List', insertText: '+ ' },
240-
{ label: '/ - List', insertText: '- ' },
241-
{ label: '/ > Blockquote', insertText: '> ' },
242-
{ label: '/ ` Code', insertText: '`$1`', surroundSelection: '$1', },
243-
{ label: '/ * Italic', insertText: '*$1*', surroundSelection: '$1', },
244-
{ label: '/ _ Italic', insertText: '_$1_', surroundSelection: '$1', },
245-
{ label: '/ ~ Sub', insertText: '~$1~', surroundSelection: '$1', },
246-
{ label: '/ ^ Sup', insertText: '^$1^', surroundSelection: '$1', },
247-
{ label: '/ ** Bold', insertText: '**$1**', surroundSelection: '$1', },
248-
{ label: '/ __ Bold', insertText: '__$1__', surroundSelection: '$1', },
249-
{ label: '/ ~~ Delete', insertText: '~~$1~~', surroundSelection: '$1', },
250-
{ label: '/ == Mark', insertText: '==$1==', surroundSelection: '$1', },
251-
{ label: '/ ``` Fence', insertText: '```$1\n$2\n```\n', block: true, surroundSelection: '$2', },
252-
{ label: '/ --- Horizontal Line', insertText: '---\n', block: true },
253-
{ label: '/ + [ ] TODO List', insertText: '+ [ ] ' },
254-
{ label: '/ - [ ] TODO List', insertText: '- [ ] ' },
241+
{ language: 'markdown', label: '/ ![]() Image', insertText: '![${2:Img}]($1)' },
242+
{ language: 'markdown', label: '/ []() Link', insertText: '[${2:Link}]($1)' },
243+
{ language: 'markdown', label: '/ # Head 1', insertText: '# $1', block: true },
244+
{ language: 'markdown', label: '/ ## Head 2', insertText: '## $1', block: true },
245+
{ language: 'markdown', label: '/ ### Head 3', insertText: '### $1', block: true },
246+
{ language: 'markdown', label: '/ #### Head 4', insertText: '#### $1', block: true },
247+
{ language: 'markdown', label: '/ ##### Head 5', insertText: '##### $1', block: true },
248+
{ language: 'markdown', label: '/ ###### Head 6', insertText: '###### $1', block: true },
249+
{ language: 'markdown', label: '/ + List', insertText: '+ ' },
250+
{ language: 'markdown', label: '/ - List', insertText: '- ' },
251+
{ language: 'markdown', label: '/ > Blockquote', insertText: '> ' },
252+
{ language: 'markdown', label: '/ ` Code', insertText: '`$1`', surroundSelection: '$1', },
253+
{ language: 'markdown', label: '/ * Italic', insertText: '*$1*', surroundSelection: '$1', },
254+
{ language: 'markdown', label: '/ _ Italic', insertText: '_$1_', surroundSelection: '$1', },
255+
{ language: 'markdown', label: '/ ~ Sub', insertText: '~$1~', surroundSelection: '$1', },
256+
{ language: 'markdown', label: '/ ^ Sup', insertText: '^$1^', surroundSelection: '$1', },
257+
{ language: 'markdown', label: '/ ** Bold', insertText: '**$1**', surroundSelection: '$1', },
258+
{ language: 'markdown', label: '/ __ Bold', insertText: '__$1__', surroundSelection: '$1', },
259+
{ language: 'markdown', label: '/ ~~ Delete', insertText: '~~$1~~', surroundSelection: '$1', },
260+
{ language: 'markdown', label: '/ == Mark', insertText: '==$1==', surroundSelection: '$1', },
261+
{ language: 'markdown', label: '/ ``` Fence', insertText: '```$1\n$2\n```\n', block: true, surroundSelection: '$2', },
262+
{ language: 'markdown', label: '/ --- Horizontal Line', insertText: '---\n', block: true },
263+
{ language: 'markdown', label: '/ + [ ] TODO List', insertText: '+ [ ] ' },
264+
{ language: 'markdown', label: '/ - [ ] TODO List', insertText: '- [ ] ' },
255265
)
256266
})
257267

0 commit comments

Comments
 (0)