Skip to content

<foo> turn into &lt;foo&gt; when cut from a md code block to another code block #10722

Closed
@Shina-SG

Description

@Shina-SG

Is there an existing issue for this?

  • I have searched the existing issues

Can the issue be reproduced with the default theme (daylight/midnight)?

  • I was able to reproduce the issue with the default theme

Could the issue be due to extensions?

  • I've ruled out the possibility that the extension is causing the problem.

Describe the problem

<test> turn into &lt;test&gt; when using cut (not copy) from a code block with markdown language` and paste to another code block with any language.

Way to reproduce the bug:

  1. Create any new doc.
  2. Create 2 code blocks.
  3. Change the language of the first code block to md (markdown) while the second code block can be anything or none.
  4. Type in 2 <test> in the first code block.
  5. Cut the 2 <test> in the first code block and paste to the second code block.

Note:

  • When using the mouse to select just one <test> and cut and paste it work fine, but when there's more than one <test> or use Ctrl + A to select the one <test> it turn break.
  • Copy and paste works, only cut and paste break.

Expected result

The pasted <test> should still be the same.

Screenshot or screen recording presentation

No response

Version environment

- Version: v3.0.4
- Operating System: Windows 11
- Browser (if used):

Log file

Test.zip

I 2024/03/23 11:27:49 working.go:146: 
      ___                                   ___           ___           ___
     /  /\        ___           ___        /__/\         /  /\         /__/\
    /  /:/_      /  /\         /__/|       \  \:\       /  /::\        \  \:\
   /  /:/ /\    /  /:/        |  |:|        \  \:\     /  /:/\:\        \  \:\
  /  /:/ /::\  /__/::\        |  |:|    ___  \  \:\   /  /:/~/::\   _____\__\:\
 /__/:/ /:/\:\ \__\/\:\__   __|__|:|   /__/\  \__\:\ /__/:/ /:/\:\ /__/::::::::\
 \  \:\/:/~/:/    \  \:\/\ /__/::::\   \  \:\ /  /:/ \  \:\/:/__\/ \  \:\~~\~~\/
  \  \::/ /:/      \__\::/    ~\~~\:\   \  \:\  /:/   \  \::/       \  \:\  ~~~
   \__\/ /:/       /__/:/       \  \:\   \  \:\/:/     \  \:\        \  \:\
     /__/:/        \__\/         \__\/    \  \::/       \  \:\        \  \:\
     \__\/                                 \__\/         \__\/         \__\/
I 2024/03/23 11:27:49 runtime.go:74: kernel is booting:
    * ver [3.0.4]
    * arch [amd64]
    * os [Microsoft Windows 11 IoT Enterprise]
    * pid [6288]
    * runtime mode [prod]
    * working directory [C:\Users\Administrator\AppData\Local\Programs\SiYuan\resources]
    * read only [false]
    * container [std]
    * database [ver=20220501]
    * workspace directory [C:\Shina\Test]
I 2024/03/23 11:27:49 conf.go:156: initialized language [en_US] based on device locale
I 2024/03/23 11:27:49 runtime.go:123: use network proxy [system]
I 2024/03/23 11:27:49 serve.go:115: kernel [pid=6288] http server [127.0.0.1:62169] is booting
I 2024/03/23 11:27:50 database.go:89: the database structure is changed, rebuilding database...
I 2024/03/23 11:27:50 database.go:109: reinitialized database [C:\Shina\Test\temp\siyuan.db]
I 2024/03/23 11:27:50 conf.go:807: database size [4.1 kB], tree/block count [0/0]
I 2024/03/23 11:27:50 working.go:192: kernel booted
I 2024/03/23 11:27:50 box.go:76: auto stat [trees=0, blocks=0, dataSize=37 kB, assetsSize=0 B]
I 2024/03/23 11:27:50 disk.go:33: disk usage [total=999 GB, used=309 GB, free=690 GB]
I 2024/03/23 11:27:50 index.go:197: rebuilt database for notebook [20210808180117-6v0mkxr] in [0.01s], tree [count=66, size=1.2 MB]
I 2024/03/23 11:27:51 index.go:269: resolved refs [31] in [20ms]
I 2024/03/23 11:27:51 pandoc.go:155: initialized built-in pandoc [ver=3.1.1, bin=C:\Shina\Test\temp\pandoc\bin\pandoc.exe]
I 2024/03/23 11:27:51 conf.go:1051: pandoc initialized, set pandoc bin to [C:\Shina\Test\temp\pandoc\bin\pandoc.exe]
I 2024/03/23 11:27:55 index.go:197: rebuilt database for notebook [20240323112755-gowkgwl] in [0.00s], tree [count=0, size=0 B]
I 2024/03/23 11:27:56 index.go:269: resolved refs [31] in [19ms]
W 2024/03/23 11:27:58 blocktree.go:552: save block tree [size=633 kB] to [C:\Shina\Test\temp\blocktree], elapsed [3.73s]
I 2024/03/23 11:31:02 conf.go:547: exiting kernel [force=false, execInstallPkg=0]
I 2024/03/23 11:31:05 conf.go:1041: closed user guide box [20210808180117-6v0mkxr]
I 2024/03/23 11:31:05 database.go:1244: closed database
W 2024/03/23 11:31:08 blocktree.go:552: save block tree [size=877 B] to [C:\Shina\Test\temp\blocktree], elapsed [3.87s]
I 2024/03/23 11:31:08 conf.go:970: cleared workspace temp
I 2024/03/23 11:31:08 sync.go:712: sync websocket closed
I 2024/03/23 11:31:09 conf.go:615: exited kernel
I 2024/03/23 11:31:13 working.go:146: 
      ___                                   ___           ___           ___
     /  /\        ___           ___        /__/\         /  /\         /__/\
    /  /:/_      /  /\         /__/|       \  \:\       /  /::\        \  \:\
   /  /:/ /\    /  /:/        |  |:|        \  \:\     /  /:/\:\        \  \:\
  /  /:/ /::\  /__/::\        |  |:|    ___  \  \:\   /  /:/~/::\   _____\__\:\
 /__/:/ /:/\:\ \__\/\:\__   __|__|:|   /__/\  \__\:\ /__/:/ /:/\:\ /__/::::::::\
 \  \:\/:/~/:/    \  \:\/\ /__/::::\   \  \:\ /  /:/ \  \:\/:/__\/ \  \:\~~\~~\/
  \  \::/ /:/      \__\::/    ~\~~\:\   \  \:\  /:/   \  \::/       \  \:\  ~~~
   \__\/ /:/       /__/:/       \  \:\   \  \:\/:/     \  \:\        \  \:\
     /__/:/        \__\/         \__\/    \  \::/       \  \:\        \  \:\
     \__\/                                 \__\/         \__\/         \__\/
I 2024/03/23 11:31:13 runtime.go:74: kernel is booting:
    * ver [3.0.4]
    * arch [amd64]
    * os [Microsoft Windows 11 IoT Enterprise]
    * pid [8756]
    * runtime mode [prod]
    * working directory [C:\Users\Administrator\AppData\Local\Programs\SiYuan\resources]
    * read only [false]
    * container [std]
    * database [ver=20220501]
    * workspace directory [C:\Shina\Test]
I 2024/03/23 11:31:13 runtime.go:123: use network proxy [system]
I 2024/03/23 11:31:13 serve.go:115: kernel [pid=8756] http server [127.0.0.1:62260] is booting
I 2024/03/23 11:31:13 blocktree.go:495: read block tree [877 B] to [C:\Shina\Test\temp\blocktree], elapsed [0.00s]
I 2024/03/23 11:31:13 conf.go:807: database size [7.5 MB], tree/block count [1/3]
I 2024/03/23 11:31:13 working.go:192: kernel booted
I 2024/03/23 11:31:13 pandoc.go:132: built-in pandoc [ver=3.1.1, bin=C:\Shina\Test\temp\pandoc\bin\pandoc.exe]
I 2024/03/23 11:31:13 conf.go:1051: pandoc initialized, set pandoc bin to [C:\Shina\Test\temp\pandoc\bin\pandoc.exe]
I 2024/03/23 11:31:13 box.go:76: auto stat [trees=1, blocks=3, dataSize=65 kB, assetsSize=0 B]
I 2024/03/23 11:31:13 disk.go:33: disk usage [total=999 GB, used=309 GB, free=690 GB]
I 2024/03/23 11:40:09 database.go:109: reinitialized database [C:\Shina\Test\temp\siyuan.db]
I 2024/03/23 11:40:09 index.go:197: rebuilt database for notebook [20240323112755-gowkgwl] in [0.00s], tree [count=1, size=889 B]
I 2024/03/23 11:40:10 index.go:269: resolved refs [0] in [0ms]
I 2024/03/23 11:42:18 database.go:109: reinitialized database [C:\Shina\Test\temp\siyuan.db]
I 2024/03/23 11:42:18 index.go:197: rebuilt database for notebook [20240323112755-gowkgwl] in [0.00s], tree [count=1, size=971 B]
I 2024/03/23 11:42:18 index.go:269: resolved refs [0] in [0ms]
I 2024/03/23 11:43:35 conf.go:547: exiting kernel [force=false, execInstallPkg=0]
I 2024/03/23 11:43:35 database.go:1244: closed database
I 2024/03/23 11:43:35 conf.go:970: cleared workspace temp
I 2024/03/23 11:43:36 sync.go:712: sync websocket closed
I 2024/03/23 11:43:36 conf.go:615: exited kernel
I 2024/03/23 11:43:41 working.go:146: 
      ___                                   ___           ___           ___
     /  /\        ___           ___        /__/\         /  /\         /__/\
    /  /:/_      /  /\         /__/|       \  \:\       /  /::\        \  \:\
   /  /:/ /\    /  /:/        |  |:|        \  \:\     /  /:/\:\        \  \:\
  /  /:/ /::\  /__/::\        |  |:|    ___  \  \:\   /  /:/~/::\   _____\__\:\
 /__/:/ /:/\:\ \__\/\:\__   __|__|:|   /__/\  \__\:\ /__/:/ /:/\:\ /__/::::::::\
 \  \:\/:/~/:/    \  \:\/\ /__/::::\   \  \:\ /  /:/ \  \:\/:/__\/ \  \:\~~\~~\/
  \  \::/ /:/      \__\::/    ~\~~\:\   \  \:\  /:/   \  \::/       \  \:\  ~~~
   \__\/ /:/       /__/:/       \  \:\   \  \:\/:/     \  \:\        \  \:\
     /__/:/        \__\/         \__\/    \  \::/       \  \:\        \  \:\
     \__\/                                 \__\/         \__\/         \__\/
I 2024/03/23 11:43:41 runtime.go:74: kernel is booting:
    * ver [3.0.4]
    * arch [amd64]
    * os [Microsoft Windows 11 IoT Enterprise]
    * pid [5856]
    * runtime mode [prod]
    * working directory [C:\Users\Administrator\AppData\Local\Programs\SiYuan\resources]
    * read only [false]
    * container [std]
    * database [ver=20220501]
    * workspace directory [C:\Shina\Test]
I 2024/03/23 11:43:41 runtime.go:123: use network proxy [system]
I 2024/03/23 11:43:41 serve.go:115: kernel [pid=5856] http server [127.0.0.1:62385] is booting
I 2024/03/23 11:43:41 blocktree.go:495: read block tree [624 B] to [C:\Shina\Test\temp\blocktree], elapsed [0.00s]
I 2024/03/23 11:43:41 conf.go:807: database size [74 kB], tree/block count [1/3]
I 2024/03/23 11:43:41 working.go:192: kernel booted
I 2024/03/23 11:43:41 pandoc.go:132: built-in pandoc [ver=3.1.1, bin=C:\Shina\Test\temp\pandoc\bin\pandoc.exe]
I 2024/03/23 11:43:41 conf.go:1051: pandoc initialized, set pandoc bin to [C:\Shina\Test\temp\pandoc\bin\pandoc.exe]
I 2024/03/23 11:43:42 box.go:76: auto stat [trees=1, blocks=3, dataSize=74 kB, assetsSize=0 B]
I 2024/03/23 11:43:42 disk.go:33: disk usage [total=999 GB, used=309 GB, free=690 GB]
I 2024/03/23 11:45:01 database.go:109: reinitialized database [C:\Shina\Test\temp\siyuan.db]
I 2024/03/23 11:45:01 index.go:197: rebuilt database for notebook [20240323112755-gowkgwl] in [0.00s], tree [count=1, size=971 B]
I 2024/03/23 11:45:01 index.go:269: resolved refs [0] in [0ms]
I 2024/03/23 11:50:58 database.go:109: reinitialized database [C:\Shina\Test\temp\siyuan.db]
I 2024/03/23 11:50:58 index.go:197: rebuilt database for notebook [20240323112755-gowkgwl] in [0.00s], tree [count=1, size=971 B]
I 2024/03/23 11:50:58 index.go:269: resolved refs [0] in [0ms]
I 2024/03/23 11:51:00 conf.go:547: exiting kernel [force=false, execInstallPkg=0]
I 2024/03/23 11:51:01 database.go:1244: closed database
I 2024/03/23 11:51:01 conf.go:970: cleared workspace temp
I 2024/03/23 11:51:01 sync.go:712: sync websocket closed
I 2024/03/23 11:51:02 conf.go:615: exited kernel
I 2024/03/23 11:51:11 working.go:146: 
      ___                                   ___           ___           ___
     /  /\        ___           ___        /__/\         /  /\         /__/\
    /  /:/_      /  /\         /__/|       \  \:\       /  /::\        \  \:\
   /  /:/ /\    /  /:/        |  |:|        \  \:\     /  /:/\:\        \  \:\
  /  /:/ /::\  /__/::\        |  |:|    ___  \  \:\   /  /:/~/::\   _____\__\:\
 /__/:/ /:/\:\ \__\/\:\__   __|__|:|   /__/\  \__\:\ /__/:/ /:/\:\ /__/::::::::\
 \  \:\/:/~/:/    \  \:\/\ /__/::::\   \  \:\ /  /:/ \  \:\/:/__\/ \  \:\~~\~~\/
  \  \::/ /:/      \__\::/    ~\~~\:\   \  \:\  /:/   \  \::/       \  \:\  ~~~
   \__\/ /:/       /__/:/       \  \:\   \  \:\/:/     \  \:\        \  \:\
     /__/:/        \__\/         \__\/    \  \::/       \  \:\        \  \:\
     \__\/                                 \__\/         \__\/         \__\/
I 2024/03/23 11:51:11 runtime.go:74: kernel is booting:
    * ver [3.0.4]
    * arch [amd64]
    * os [Microsoft Windows 11 IoT Enterprise]
    * pid [7004]
    * runtime mode [prod]
    * working directory [C:\Users\Administrator\AppData\Local\Programs\SiYuan\resources]
    * read only [false]
    * container [std]
    * database [ver=20220501]
    * workspace directory [C:\Shina\Test]
I 2024/03/23 11:51:11 runtime.go:123: use network proxy [system]
I 2024/03/23 11:51:11 serve.go:115: kernel [pid=7004] http server [127.0.0.1:62489] is booting
I 2024/03/23 11:51:11 blocktree.go:495: read block tree [624 B] to [C:\Shina\Test\temp\blocktree], elapsed [0.00s]
I 2024/03/23 11:51:11 conf.go:807: database size [74 kB], tree/block count [1/3]
I 2024/03/23 11:51:11 working.go:192: kernel booted
I 2024/03/23 11:51:11 pandoc.go:132: built-in pandoc [ver=3.1.1, bin=C:\Shina\Test\temp\pandoc\bin\pandoc.exe]
I 2024/03/23 11:51:11 conf.go:1051: pandoc initialized, set pandoc bin to [C:\Shina\Test\temp\pandoc\bin\pandoc.exe]
I 2024/03/23 11:51:11 box.go:76: auto stat [trees=1, blocks=3, dataSize=73 kB, assetsSize=0 B]
I 2024/03/23 11:51:11 disk.go:33: disk usage [total=999 GB, used=309 GB, free=690 GB]
I 2024/03/23 11:51:33 conf.go:547: exiting kernel [force=false, execInstallPkg=0]
I 2024/03/23 11:51:35 database.go:1244: closed database
I 2024/03/23 11:51:35 conf.go:970: cleared workspace temp
I 2024/03/23 11:51:35 sync.go:712: sync websocket closed
I 2024/03/23 11:51:36 conf.go:615: exited kernel
I 2024/03/24 20:40:54 working.go:146: 
      ___                                   ___           ___           ___
     /  /\        ___           ___        /__/\         /  /\         /__/\
    /  /:/_      /  /\         /__/|       \  \:\       /  /::\        \  \:\
   /  /:/ /\    /  /:/        |  |:|        \  \:\     /  /:/\:\        \  \:\
  /  /:/ /::\  /__/::\        |  |:|    ___  \  \:\   /  /:/~/::\   _____\__\:\
 /__/:/ /:/\:\ \__\/\:\__   __|__|:|   /__/\  \__\:\ /__/:/ /:/\:\ /__/::::::::\
 \  \:\/:/~/:/    \  \:\/\ /__/::::\   \  \:\ /  /:/ \  \:\/:/__\/ \  \:\~~\~~\/
  \  \::/ /:/      \__\::/    ~\~~\:\   \  \:\  /:/   \  \::/       \  \:\  ~~~
   \__\/ /:/       /__/:/       \  \:\   \  \:\/:/     \  \:\        \  \:\
     /__/:/        \__\/         \__\/    \  \::/       \  \:\        \  \:\
     \__\/                                 \__\/         \__\/         \__\/
I 2024/03/24 20:40:54 runtime.go:74: kernel is booting:
    * ver [3.0.4]
    * arch [amd64]
    * os [Microsoft Windows 11 IoT Enterprise]
    * pid [15684]
    * runtime mode [prod]
    * working directory [C:\Users\Administrator\AppData\Local\Programs\SiYuan\resources]
    * read only [false]
    * container [std]
    * database [ver=20220501]
    * workspace directory [C:\Shina\Test]
I 2024/03/24 20:40:54 runtime.go:123: use network proxy [system]
I 2024/03/24 20:40:54 serve.go:115: kernel [pid=15684] http server [127.0.0.1:63204] is booting
I 2024/03/24 20:40:54 blocktree.go:495: read block tree [624 B] to [C:\Shina\Test\temp\blocktree], elapsed [0.00s]
I 2024/03/24 20:40:54 conf.go:807: database size [74 kB], tree/block count [1/3]
I 2024/03/24 20:40:54 working.go:192: kernel booted
I 2024/03/24 20:40:54 pandoc.go:132: built-in pandoc [ver=3.1.1, bin=C:\Shina\Test\temp\pandoc\bin\pandoc.exe]
I 2024/03/24 20:40:54 conf.go:1051: pandoc initialized, set pandoc bin to [C:\Shina\Test\temp\pandoc\bin\pandoc.exe]
I 2024/03/24 20:40:54 box.go:76: auto stat [trees=1, blocks=3, dataSize=73 kB, assetsSize=0 B]
I 2024/03/24 20:40:54 disk.go:33: disk usage [total=999 GB, used=306 GB, free=693 GB]
I 2024/03/24 20:44:25 conf.go:547: exiting kernel [force=false, execInstallPkg=0]
I 2024/03/24 20:44:25 database.go:1244: closed database
I 2024/03/24 20:44:25 conf.go:970: cleared workspace temp
I 2024/03/24 20:44:26 sync.go:712: sync websocket closed
I 2024/03/24 20:45:36 working.go:146: 
      ___                                   ___           ___           ___
     /  /\        ___           ___        /__/\         /  /\         /__/\
    /  /:/_      /  /\         /__/|       \  \:\       /  /::\        \  \:\
   /  /:/ /\    /  /:/        |  |:|        \  \:\     /  /:/\:\        \  \:\
  /  /:/ /::\  /__/::\        |  |:|    ___  \  \:\   /  /:/~/::\   _____\__\:\
 /__/:/ /:/\:\ \__\/\:\__   __|__|:|   /__/\  \__\:\ /__/:/ /:/\:\ /__/::::::::\
 \  \:\/:/~/:/    \  \:\/\ /__/::::\   \  \:\ /  /:/ \  \:\/:/__\/ \  \:\~~\~~\/
  \  \::/ /:/      \__\::/    ~\~~\:\   \  \:\  /:/   \  \::/       \  \:\  ~~~
   \__\/ /:/       /__/:/       \  \:\   \  \:\/:/     \  \:\        \  \:\
     /__/:/        \__\/         \__\/    \  \::/       \  \:\        \  \:\
     \__\/                                 \__\/         \__\/         \__\/
I 2024/03/24 20:45:36 runtime.go:74: kernel is booting:
    * ver [3.0.4]
    * arch [amd64]
    * os [Microsoft Windows 11 IoT Enterprise]
    * pid [4408]
    * runtime mode [prod]
    * working directory [C:\Users\Administrator\AppData\Local\Programs\SiYuan\resources]
    * read only [false]
    * container [std]
    * database [ver=20220501]
    * workspace directory [C:\Shina\Test]
I 2024/03/24 20:45:36 runtime.go:123: use network proxy [system]
I 2024/03/24 20:45:36 serve.go:115: kernel [pid=4408] http server [127.0.0.1:49797] is booting
I 2024/03/24 20:45:36 blocktree.go:495: read block tree [624 B] to [C:\Shina\Test\temp\blocktree], elapsed [0.00s]
I 2024/03/24 20:45:36 conf.go:807: database size [74 kB], tree/block count [1/3]
I 2024/03/24 20:45:36 working.go:192: kernel booted
I 2024/03/24 20:45:36 pandoc.go:132: built-in pandoc [ver=3.1.1, bin=C:\Shina\Test\temp\pandoc\bin\pandoc.exe]
I 2024/03/24 20:45:36 conf.go:1051: pandoc initialized, set pandoc bin to [C:\Shina\Test\temp\pandoc\bin\pandoc.exe]
I 2024/03/24 20:45:36 box.go:76: auto stat [trees=1, blocks=3, dataSize=73 kB, assetsSize=0 B]
I 2024/03/24 20:45:36 disk.go:33: disk usage [total=999 GB, used=306 GB, free=693 GB]
I 2024/03/24 20:45:37 serve.go:128: reverse proxy server [127.0.0.1:6806] is booting
I 2024/03/24 21:13:22 conf.go:547: exiting kernel [force=false, execInstallPkg=0]
I 2024/03/24 21:13:23 database.go:1244: closed database
I 2024/03/24 21:13:23 conf.go:970: cleared workspace temp
I 2024/03/24 21:13:23 sync.go:712: sync websocket closed

More information

No response

Activity

changed the title [-]`<test>` turn into `&lt;test&gt;` when cut from a md code block to another code block[/-] [+]`<foo>` turn into `&lt;foo&gt;` when cut from a md code block to another code block[/+] on Mar 24, 2024
added this to the 3.0.5 milestone on Mar 24, 2024
added a commit that references this issue on Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @88250@Vanessa219@Shina-SG

      Issue actions

        `<foo>` turn into `&lt;foo&gt;` when cut from a md code block to another code block · Issue #10722 · siyuan-note/siyuan