laurent22 / joplin

Joplin - the privacy-focused note taking app with sync capabilities for Windows, macOS, Linux, Android and iOS.
https://joplinapp.org
Other
45.13k stars 4.91k forks source link

Find and replace in WYSIWYG doesn't work for code blocks and inline #9504

Open tconsta opened 9 months ago

tconsta commented 9 months ago

Operating system

macOS

Joplin version

2.13.9

Desktop version info

Joplin 2.13.9 (prod, darwin)

Client ID: 889dbc1460b245dfba2a21505e72936b Sync Version: 3 Profile Version: 44 Keychain Supported: Yes

Revision: 1bbec44

Note Tabs: 1.4.0

Current behaviour

  1. Create a code block or inline code in any note with any unique string pattern
  2. Press Cmd+P and enter the same pattern, you'll see the note, switch to it
  3. Choose WYSIWYG mode
  4. Press Ctrl+F and enter the pattern
  5. No results...
  6. Switch to markdown, press Ctrl+F, here it works

Expected behaviour

Option "Find and replace" in WYSIWYG mode should search, among other things, in code blocks.

Logs

No response

personalizedrefrigerator commented 7 months ago

Upstream issue (inline code): https://github.com/tinymce/tinymce/issues/6966

It looks like TinyMCE's search plugin skips whitespace and non-contenteditable elements: https://github.com/tinymce/tinymce/blob/751e35f1419a6a060ded397dda1b2945bacaa711/modules/tinymce/src/plugins/searchreplace/main/ts/core/TextCollect.ts#L48

It seems that code is a whitespace element.

Options for inline code:

personalizedrefrigerator commented 7 months ago

Possible duplicate of https://github.com/laurent22/joplin/issues/8184