Skip to content

Commit f1ca468

Browse files
committed
fix: cut and paste pseudocode will copy the HTML
1 parent d5d2275 commit f1ca468

File tree

8 files changed

+13
-5
lines changed

8 files changed

+13
-5
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ Click the menu button on the left side of a Pseudocode Widget block. An option l
8686

8787
## Changelog
8888

89+
+ v0.5.5
90+
+ Fix: cut and paste pseudocode code will copy the HTML
91+
+ Feature: type `/伪代码` can also create a new pseudocode block
8992
+ v0.5.4
9093
+ Update plugin name
9194
+ v0.5.3

README_zh_CN.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@
8585

8686
## 更新日志
8787

88+
+ v0.5.5
89+
+ 修复缺陷:复制时会复制到html
90+
+ 功能优化:输入 `/伪代码` 也可创建伪代码块
8891
+ v0.5.4
8992
+ 更新插件名
9093
+ v0.5.3

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "siyuan-embed-pseudocode",
3-
"version": "0.5.4",
3+
"version": "0.5.5",
44
"type": "module",
55
"description": "This is a plugin for siyuan",
66
"author": "",

plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "siyuan-embed-pseudocode",
33
"author": "Yuxin Zhao",
44
"url": "https://github.com/YuxinZhaozyx/siyuan-embed-pseudocode",
5-
"version": "0.5.4",
5+
"version": "0.5.5",
66
"minAppVersion": "3.3.0",
77
"disabledInPublish": false,
88
"backends": [

src/i18n/en_US.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"pseudocode": "Pseudocode",
23
"noMessage": "no message",
34
"compile": "compile",
45
"compiling": "compiling",

src/i18n/zh_CN.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"pseudocode": "伪代码",
23
"noMessage": "无信息",
34
"compile": "编译",
45
"compiling": "编译中",

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ export default class PseudocodePlugin extends Plugin {
6666
this._mutationObserver = setAutoCompileMuatationObserver(document.body);
6767

6868
this.protyleSlash = [{
69-
filter: ["pseudocode"],
69+
filter: ["pseudocode", "伪代码", "weidaima"],
7070
id: "pseudocode",
71-
html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconCode"></use></svg><span class="b3-list-item__text">pseudocode</span></div>`,
71+
html: `<div class="b3-list-item__first"><svg class="b3-list-item__graphic"><use xlink:href="#iconCode"></use></svg><span class="b3-list-item__text">${this.i18n.pseudocode}</span></div>`,
7272
callback: (protyle, nodeElement) => {
7373
const code = "";
7474
const blockID = nodeElement.getAttribute("data-node-id");

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export function switchPseudocodeView(mode: "on" | "off", blockElement: HTMLEleme
109109
const containerElement = blockElement.querySelector(".pseudocode-container");
110110
if (mode === "on") {
111111
if (!containerElement) {
112-
codeElement.insertAdjacentHTML('afterend', '<div class="pseudocode-container" contenteditable="false"></div>');
112+
codeElement.insertAdjacentHTML('afterend', '<div spin="1" class="pseudocode-container" contenteditable="false"></div>');
113113
}
114114
} else {
115115
if (containerElement) containerElement.remove();

0 commit comments

Comments
 (0)