🐛 光标定位到行内元素内部时粘贴为纯文本不应带标记符 https://github.com/siyuan-note/insider/issues/1057

This commit is contained in:
Liang Ding 2022-09-19 16:53:01 +08:00
parent c0c795c214
commit 106a8db616
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
5 changed files with 7 additions and 7 deletions

4
app/pnpm-lock.yaml generated
View file

@ -1906,10 +1906,10 @@ packages:
resolution: {integrity: sha512-m0+M53+HYMzqKxwNQZT143K7WwXEGUy9LY31l8dJphXx2P/FQod615mVbxHyqbDCG4J5bHdWm21qZ0e2DVY6CQ==}
engines: {node: '>=14.0.0'}
dependencies:
7zip-bin: 5.1.1
'@develar/schema-utils': 2.6.5
'@electron/universal': 1.2.1
'@malept/flatpak-bundler': 0.4.0
7zip-bin: 5.1.1
async-exit-hook: 2.0.1
bluebird-lst: 1.0.9
builder-util: 23.3.3
@ -2193,9 +2193,9 @@ packages:
/builder-util/23.3.3:
resolution: {integrity: sha512-MJZlUiq2PY5hjYv9+XNaoYdsITqvLgRDoHSFg/4nzpInbNxNjLQOolL04Zsyp+hgfcbFvMC4h0KkR1CMPHLWbA==}
dependencies:
7zip-bin: 5.1.1
'@types/debug': 4.1.7
'@types/fs-extra': 9.0.13
7zip-bin: 5.1.1
app-builder-bin: 4.0.0
bluebird-lst: 1.0.9
builder-util-runtime: 9.0.3

View file

@ -510,7 +510,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
accelerator: "⌘C",
icon: "iconCopy",
click() {
writeText(protyle.lute.BlockDOM2Md(assetElement.outerHTML));
writeText(protyle.lute.BlockDOM2StdMd(assetElement.outerHTML));
}
}).element);
window.siyuan.menus.menu.append(new MenuItem({
@ -548,7 +548,7 @@ export const imgMenu = (protyle: IProtyle, range: Range, assetElement: HTMLEleme
accelerator: "⌘X",
label: window.siyuan.languages.cut,
click() {
writeText(protyle.lute.BlockDOM2Md(assetElement.outerHTML));
writeText(protyle.lute.BlockDOM2StdMd(assetElement.outerHTML));
(assetElement as HTMLElement).outerHTML = "<wbr>";
nodeElement.setAttribute("updated", dayjs().format("YYYYMMDDHHmmss"));
updateTransaction(protyle, id, nodeElement.outerHTML, html);

View file

@ -199,8 +199,6 @@ declare class Lute {
public PutEmojis(emojis: IObject): void;
public BlockDOM2Md(html: string): string;
public SpinBlockDOM(html: string): string;
public Md2BlockDOM(html: string): string;

View file

@ -7,7 +7,7 @@ require (
github.com/88250/css v0.1.2
github.com/88250/flock v0.8.2
github.com/88250/gulu v1.2.3-0.20220916075322-eb117059d70a
github.com/88250/lute v1.7.5-0.20220919023317-f20f5cef5f56
github.com/88250/lute v1.7.5-0.20220919070155-de3fd729795b
github.com/88250/pdfcpu v0.3.13
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1
github.com/ConradIrwin/font v0.0.0-20210318200717-ce8d41cc0732

View file

@ -27,6 +27,8 @@ github.com/88250/lute v1.7.5-0.20220919015919-e05391a106b3 h1:F78DnfTxvC2ugvvt17
github.com/88250/lute v1.7.5-0.20220919015919-e05391a106b3/go.mod h1:cEoBGi0zArPqAsp0MdG9SKinvH/xxZZWXU7sRx8vHSA=
github.com/88250/lute v1.7.5-0.20220919023317-f20f5cef5f56 h1:I3kvJm2iO9VhFTGChKaOASrRgMmnVhGgYrsUE0gXHyY=
github.com/88250/lute v1.7.5-0.20220919023317-f20f5cef5f56/go.mod h1:cEoBGi0zArPqAsp0MdG9SKinvH/xxZZWXU7sRx8vHSA=
github.com/88250/lute v1.7.5-0.20220919070155-de3fd729795b h1:dTuGmFlpbZ7SmdnkrBa9onRJBB68EUI2ARnVe4FveTM=
github.com/88250/lute v1.7.5-0.20220919070155-de3fd729795b/go.mod h1:cEoBGi0zArPqAsp0MdG9SKinvH/xxZZWXU7sRx8vHSA=
github.com/88250/pdfcpu v0.3.13 h1:touMWMZkCGalMIbEg9bxYp7rETM+zwb9hXjwhqi4I7Q=
github.com/88250/pdfcpu v0.3.13/go.mod h1:S5YT38L/GCjVjmB4PB84PymA1qfopjEhfhTNQilLpv4=
github.com/88250/vitess-sqlparser v0.0.0-20210205111146-56a2ded2aba1 h1:48T899JQDwyyRu9yXHePYlPdHtpJfrJEUGBMH3SMBWY=