laurent22 / joplin

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

Rich text editor: Mermaid diagram source adds an extra line on each load/save #9589

Open personalizedrefrigerator opened 9 months ago

personalizedrefrigerator commented 9 months ago

Operating system

Linux

Joplin version

2.13.9

Desktop version info

Joplin 2.13.9 (prod, linux)

Client ID: 24b2a961cccf40fe8448cdc0930b6fce Sync Version: 3 Profile Version: 44 Keychain Supported: No

Revision: 1bbec445d

Freehand Drawing: 2.7.1 RevealJS Integration: 0.6.1 Simple Backup: 1.3.4 Work tracker: 0.0.1

Current behaviour

  1. Create a new note and switch to the rich text editor
  2. Add a code block with language mermaid
  3. Set to the following content:
    gitGraph
    commit
    commit
  4. Click "Ok"
  5. Switch to the markdown editor
  6. Switch back to the rich text editor
  7. Add a new line to the end of the document
  8. Type "test"
  9. Repeat steps 5-8 three more times.
  10. Switch to the markdown editor

The below screen recording demonstrates this and another issue:

Screen recording: Clicking on the download button does nothing, switching editors adds blank lines

Expected behaviour

New lines should not be added to the end of the Mermaid diagram's source when editing other parts of the document.

Logs

```` /home/builder/Documents/joplin/packages/app-desktop/node_modules/react-dom/cjs/react-dom.development.js:29840 Download the React DevTools for a better development experience: https://reactjs.org/link/react-devtoolsYou might need to use a local HTTP server (instead of file://): https://reactjs.org/link/react-devtools-faq main-html.js:52 Environment: dev main-html.js:52 appId: net.cozic.joplindev-desktop main-html.js:52 appType: desktop main-html.js:48 Electron Security Warning (Insecure Content-Security-Policy) This renderer process has either no Content Security Policy set or a policy with "unsafe-eval" enabled. This exposes users of this app to unnecessary security risks. For more information and help, consult https://electronjs.org/docs/tutorial/security. This warning will not show up once the app is packaged. output.warn @ main-html.js:48 main-html.js:52 15:06:09: App: Profile directory: /home/builder/.config/joplindev-desktop main-html.js:52 15:06:09: App: Root profile directory: /home/builder/.config/joplindev-desktop main-html.js:52 15:06:09: Database was open successfully main-html.js:52 15:06:09: Checking for database schema update... main-html.js:52 15:06:09: Current database version null main-html.js:52 15:06:09: Upgrading database from version 0 main-html.js:52 15:06:09: Converting database to version 1 main-html.js:52 15:06:09: Converting database to version 2 main-html.js:52 15:06:09: Converting database to version 3 main-html.js:52 15:06:09: Converting database to version 4 main-html.js:52 15:06:09: Converting database to version 5 main-html.js:52 15:06:09: Converting database to version 6 main-html.js:52 15:06:09: Converting database to version 7 main-html.js:52 15:06:09: Converting database to version 8 main-html.js:52 15:06:09: Converting database to version 9 main-html.js:52 15:06:09: Converting database to version 10 main-html.js:52 15:06:09: Converting database to version 11 main-html.js:52 15:06:09: Converting database to version 12 main-html.js:52 15:06:09: Converting database to version 13 main-html.js:52 15:06:09: Converting database to version 14 main-html.js:52 15:06:09: Converting database to version 15 main-html.js:52 15:06:09: Converting database to version 16 main-html.js:52 15:06:09: Converting database to version 17 main-html.js:52 15:06:09: Converting database to version 18 main-html.js:52 15:06:09: Converting database to version 19 main-html.js:52 15:06:09: Converting database to version 20 main-html.js:52 15:06:09: Converting database to version 21 main-html.js:52 15:06:09: Converting database to version 22 main-html.js:52 15:06:09: Converting database to version 23 main-html.js:52 15:06:09: Converting database to version 24 main-html.js:52 15:06:09: Converting database to version 25 main-html.js:52 15:06:09: Converting database to version 26 main-html.js:52 15:06:09: Converting database to version 27 main-html.js:52 15:06:09: Converting database to version 28 main-html.js:52 15:06:09: Converting database to version 29 main-html.js:52 15:06:10: Converting database to version 30 main-html.js:52 15:06:10: Converting database to version 31 main-html.js:52 15:06:10: Converting database to version 32 main-html.js:52 15:06:10: Converting database to version 33 main-html.js:52 15:06:10: Converting database to version 34 main-html.js:52 15:06:10: Migration failed with fallback and will not be repeated - saving version number main-html.js:52 15:06:10: Converting database to version 35 main-html.js:52 15:06:10: Converting database to version 36 main-html.js:52 15:06:10: Converting database to version 37 main-html.js:52 15:06:10: Converting database to version 38 main-html.js:52 15:06:10: Converting database to version 39 main-html.js:52 15:06:10: Converting database to version 40 main-html.js:52 15:06:10: Converting database to version 41 main-html.js:52 15:06:10: Converting database to version 42 main-html.js:52 15:06:10: Converting database to version 43 main-html.js:52 15:06:10: Converting database to version 44 main-html.js:52 15:06:10: Converting database to version 45 main-html.js:52 15:06:10: New version: 45. Previously recorded version: 0 main-html.js:52 15:06:10: Initializing tables... main-html.js:52 15:06:10: KeychainService: checking if keychain supported main-html.js:52 15:06:10: KeychainService: could not set test password - keychain support will be disabled main-html.js:52 15:06:10: e2ee/utils: Master password is not set - trying to get it from the active master key... main-html.js:52 15:06:10: handleSyncStartupOperation: Processing operation: 0 main-html.js:52 15:06:10: App: Client ID: 4bbdab6c280345f9b5c8fe0d4b16dc29 main-html.js:52 15:06:10: First start: detected locale as en_GB main-html.js:52 15:06:10: models/Setting: Skipping all default migrations... main-html.js:52 15:06:10: e2ee/utils: Trying to load 0 master keys... main-html.js:52 15:06:10: e2ee/utils: Loaded master keys: 0 main-html.js:52 15:06:10: ResourceFetcher: Auto-add resources: Mode: always main-html.js:52 15:06:10: ResourceFetcher: Auto-added resources: 0 main-html.js:52 15:06:10: Running migration: 20 main-html.js:52 15:06:10: Running migration: 27 main-html.js:52 15:06:10: Running migration: 33 main-html.js:52 15:06:10: SearchEngine: Updating FTS table... main-html.js:52 15:06:10: Updating items_normalized from Object main-html.js:52 15:06:10: SearchEngine: Updated FTS table in 2ms. Inserted: 0. Deleted: 0 main-html.js:52 15:06:10: Running migration: 35 main-html.js:52 15:06:10: SearchEngine: Updating FTS table... main-html.js:52 15:06:10: Updating items_normalized from Object main-html.js:52 15:06:10: SearchEngine: Updated FTS table in 3ms. Inserted: 0. Deleted: 0 main-html.js:52 15:06:10: Running migration: 42 main-html.js:52 15:06:11: App: "syncInfoCache" was changed - setting up encryption related code main-html.js:52 15:06:11: e2ee/utils: Trying to load 0 master keys... main-html.js:52 15:06:11: e2ee/utils: Loaded master keys: 0 main-html.js:52 15:06:11: Scheduling sync operation... 10000 main-html.js:52 15:06:11: Setting up recurrent sync with interval 3600 main-html.js:52 15:06:11: Recurrent sync operation DISABLED!!! main-html.js:52 15:06:11: App: "syncInfoCache" was changed - setting up encryption related code main-html.js:52 15:06:11: e2ee/utils: Trying to load 0 master keys... main-html.js:52 15:06:11: e2ee/utils: Loaded master keys: 0 main-html.js:52 15:06:11: Scheduling sync operation... 10000 main-html.js:52 15:06:11: App: "syncInfoCache" was changed - setting up encryption related code main-html.js:52 15:06:11: e2ee/utils: Trying to load 0 master keys... main-html.js:52 15:06:11: e2ee/utils: Loaded master keys: 0 main-html.js:52 15:06:11: Scheduling sync operation... 10000 main-html.js:52 15:06:11: app.start: doing regular boot main-html.js:52 15:06:11: App: Refreshing notes: null null main-html.js:52 15:06:11: App: "syncInfoCache" was changed - setting up encryption related code main-html.js:52 15:06:11: e2ee/utils: Trying to load 0 master keys... main-html.js:52 15:06:11: e2ee/utils: Loaded master keys: 0 main-html.js:52 15:06:11: Scheduling sync operation... 10000 main-html.js:52 15:06:11: Setting up recurrent sync with interval 3600 main-html.js:52 15:06:11: Recurrent sync operation DISABLED!!! main-html.js:52 15:06:11: App: "syncInfoCache" was changed - setting up encryption related code main-html.js:52 15:06:11: e2ee/utils: Trying to load 0 master keys... main-html.js:52 15:06:11: e2ee/utils: Loaded master keys: 0 main-html.js:52 15:06:11: Scheduling sync operation... 10000 main-html.js:52 15:06:11: App: "syncInfoCache" was changed - setting up encryption related code main-html.js:52 15:06:11: e2ee/utils: Trying to load 0 master keys... main-html.js:52 15:06:11: e2ee/utils: Loaded master keys: 0 main-html.js:52 15:06:11: Scheduling sync operation... 10000 main-html.js:52 15:06:11: App: Refreshing notes: null null main-html.js:52 15:06:11: Updating all notifications... main-html.js:52 15:06:11: Garbage collecting alarms... main-html.js:52 15:06:11: RevisionService: runInBackground: Starting background service with revision collection interval 600000 main-html.js:52 15:06:11: PluginService: Loading plugin from /home/builder/.config/joplindev-desktop/cache/plugin main-html.js:52 15:06:11: SpellCheckerServiceDriverNative: Set effective languages to "en-US" main-html.js:52 15:06:11: SpellCheckerServiceDriverNative: Set effective languages to "en-US" main-html.js:52 15:06:11: PluginRunner: Got message (3): joplin.plugins.register Object main-html.js:52 15:06:11: joplin.plugins: Starting plugin: io.github.jackgruber.backup main-html.js:52 15:06:11: PluginRunner: Got message (3): joplin.plugins.installationDir main-html.js:52 15:06:11: Scheduling sync operation... 15000 main-html.js:52 15:06:11: PluginRunner: Got message (3): joplin.settings.globalValue locale main-html.js:52 15:06:11: PluginRunner: Got message (3): joplin.settings.registerSection backupSection Object main-html.js:52 15:06:11: PluginRunner: Got message (3): joplin.versionInfo main-html.js:52 15:06:11: PluginRunner: Got message (3): joplin.settings.registerSettings Object main-html.js:52 15:06:11: Scheduling sync operation... 15000 main-html.js:52 15:06:11: Scheduling sync operation... 15000 main-html.js:52 15:06:11: Scheduling sync operation... 15000 main-html.js:52 15:06:11: Scheduling sync operation... 15000 main-html.js:52 15:06:12: DecryptionWorker: cannot start because no master key is currently loaded. main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.commands.register Object main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.views.menuItems.create myMenuItemToolsCreateBackup CreateBackup tools main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.views.dialogs.create backupDialog main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.views.dialogs.addScript plugin-view-io.github.jackgruber.backup-backupDialog webview.css main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.settings.value createSubfolder main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.settings.value path main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.settings.globalValue profileDir main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.settings.value backupRetention main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.settings.value zipArchive main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.settings.value compressionLevel main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.settings.value singleJexV2 main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.settings.value exportFormat main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.settings.value execFinishCmd main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.settings.value backupPlugins main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.settings.value backupSetName main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.settings.value usePassword main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.settings.setValue password password main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.settings.setValue passwordRepeat repeat12 main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.settings.value exportPath main-html.js:52 15:06:12: Scheduling sync operation... 15000 main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.settings.globalValue profileDir main-html.js:52 15:06:12: App: Refreshing notes: 2 966cfc4151524f01bc6dd3a668de4b82 main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.settings.globalValue tempDir main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.settings.value backupVersion main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.settings.setValue backupVersion 1 main-html.js:52 15:06:12: Loading existing note a6a47aa5a3944255a956973e116896a7 main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.settings.setValue backupVersion 2 main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.settings.setValue backupVersion 3 main-html.js:52 15:06:12: PluginRunner: Got message (3): joplin.settings.onChange (...args) => __awaiter(this, void 0, void 0, function* () { const callbackId = `cb_${pluginId}_${Date.now()}_${callbackIndex++}`; const promise = new Promise((resolve, reject)… main-html.js:52 15:06:12: Loaded note: Object main-html.js:52 15:06:12: joplin.plugins: Finished running onStart handler: io.github.jackgruber.backup (Took 524ms) main-html.js:52 Got ipc-message: noteRenderComplete undefined main-html.js:52 15:06:13: models/Setting: Saving settings... main-html.js:52 15:06:13: models/Setting: Settings have been saved. main-html.js:52 15:06:13: CommandService::execute: newNote main-html.js:52 15:06:13: Fetching geolocation... main-html.js:52 15:06:13: Scheduling sync operation... 15000 main-html.js:52 15:06:13: Loading existing note e425689e7ef0463d9098ee256bfca631 main-html.js:52 15:06:13: Loaded note: Object main-html.js:52 15:06:13: CodeMirror: execCommand Object main-html.js:52 Got ipc-message: noteRenderComplete undefined main-html.js:52 15:06:13: Got lat/long main-html.js:52 15:06:13: Updating lat/long of note e425689e7ef0463d9098ee256bfca631 main-html.js:52 15:06:13: Scheduling sync operation... 15000 main-html.js:52 15:06:15: RevisionService: maintenance: Starting... main-html.js:52 15:06:15: RevisionService: maintenance: Service is enabled main-html.js:52 15:06:15: RevisionService: collectRevisions: Saved revision 054f22c1505846b29888fa8b0ee3e95b (Last rev was more than 600000 ms ago) main-html.js:52 15:06:15: models/Setting: Saving settings... main-html.js:52 15:06:15: models/Setting: Settings have been saved. main-html.js:52 15:06:15: RevisionService: collectRevisions: Created revisions for 1 notes main-html.js:52 15:06:15: RevisionService: maintenance: Done in 188ms main-html.js:52 15:06:15: CommandService::execute: toggleEditors main-html.js:52 Loading script /home/builder/Documents/joplin/packages/app-desktop/vendor/lib/tinymce/tinymce.min.js main-html.js:52 Loading script: Object main-html.js:52 Loading script gui/NoteEditor/NoteBody/TinyMCE/plugins/lists.js main-html.js:52 Loading script: Object main-html.js:52 Got ipc-message: noteRenderComplete null main-html.js:52 Got ipc-message: noteRenderComplete null main-html.js:52 15:06:16: models/Setting: Saving settings... main-html.js:52 15:06:16: models/Setting: Settings have been saved. main-html.js:52 15:06:20: SearchEngine: Updating FTS table... main-html.js:52 15:06:20: models/Setting: Saving settings... main-html.js:52 15:06:20: models/Setting: Settings have been saved. main-html.js:52 15:06:20: Updating items_normalized from Object main-html.js:52 15:06:20: SearchEngine: Updated FTS table in 91ms. Inserted: 6. Deleted: 0 main-html.js:52 Got ipc-message: noteRenderComplete null main-html.js:52 15:06:28: Preparing scheduled sync main-html.js:52 15:06:28: Sync cancelled - no sync target is selected. main-html.js:52 15:06:29: Saving note... Object main-html.js:52 15:06:29: Scheduling sync operation... 15000 main-html.js:52 15:06:31: Saving note... Object main-html.js:52 15:06:31: Scheduling sync operation... 15000 main-html.js:52 15:06:33: Saving note... Object main-html.js:52 15:06:33: Scheduling sync operation... 15000 main-html.js:52 15:06:38: CommandService::execute: toggleEditors main-html.js:52 Got ipc-message: noteRenderComplete undefined main-html.js:52 15:06:39: models/Setting: Saving settings... main-html.js:52 15:06:39: models/Setting: Settings have been saved. main-html.js:52 15:06:39: SearchEngine: Updating FTS table... main-html.js:52 15:06:39: models/Setting: Saving settings... main-html.js:52 15:06:40: models/Setting: Settings have been saved. main-html.js:52 15:06:40: Updating items_normalized from Object main-html.js:52 15:06:40: SearchEngine: Updated FTS table in 63ms. Inserted: 1. Deleted: 0 main-html.js:52 15:06:40: CommandService::execute: toggleEditors main-html.js:52 Got ipc-message: noteRenderComplete null main-html.js:52 Got ipc-message: noteRenderComplete null main-html.js:52 15:06:41: ResourceService::indexNoteResources: Start main-html.js:52 15:06:41: models/Setting: Saving settings... main-html.js:52 15:06:41: models/Setting: Settings have been saved. main-html.js:52 15:06:41: ResourceService::indexNoteResources: Completed main-html.js:52 15:06:41: ResourceService::deleteOrphanResources: main-html.js:52 15:06:47: Saving note... Object main-html.js:52 15:06:47: Scheduling sync operation... 15000 main-html.js:52 15:06:48: CommandService::execute: toggleEditors main-html.js:52 Got ipc-message: noteRenderComplete undefined main-html.js:52 15:06:48: models/Setting: Saving settings... main-html.js:52 15:06:48: models/Setting: Settings have been saved. main-html.js:52 15:06:49: CommandService::execute: toggleEditors main-html.js:52 Got ipc-message: noteRenderComplete null main-html.js:52 Got ipc-message: noteRenderComplete null main-html.js:52 15:06:49: models/Setting: Saving settings... main-html.js:52 15:06:49: models/Setting: Settings have been saved. main-html.js:52 15:06:52: Saving note... Object main-html.js:52 15:06:52: Scheduling sync operation... 15000 main-html.js:52 15:06:52: CommandService::execute: toggleEditors main-html.js:52 Got ipc-message: noteRenderComplete undefined main-html.js:52 15:06:53: models/Setting: Saving settings... main-html.js:52 15:06:53: models/Setting: Settings have been saved. main-html.js:52 15:06:53: CommandService::execute: toggleEditors main-html.js:52 Got ipc-message: noteRenderComplete null main-html.js:52 Got ipc-message: noteRenderComplete null main-html.js:52 15:06:54: models/Setting: Saving settings... main-html.js:52 15:06:54: models/Setting: Settings have been saved. main-html.js:52 15:06:57: SearchEngine: Updating FTS table... main-html.js:52 15:06:57: models/Setting: Saving settings... main-html.js:52 15:06:57: models/Setting: Settings have been saved. main-html.js:52 15:06:57: Updating items_normalized from Object main-html.js:52 15:06:57: SearchEngine: Updated FTS table in 79ms. Inserted: 1. Deleted: 0 15:07:07: Preparing scheduled sync 15:07:07: Sync cancelled - no sync target is selected. 15:07:14: PluginRunner: Got message (3): joplin.settings.value backupInterval 15:07:14: PluginRunner: Got message (3): joplin.settings.value lastBackup 15:07:14: PluginRunner: Got message (3): joplin.settings.value onlyOnChange 15:07:14: PluginRunner: Got message (3): joplin.data.get ['folders'] {fields: 'title, id, updated_time', order_by: 'updated_time', order_dir: 'DESC', limit: 10, page: 1} 15:07:14: PluginRunner: Got message (3): joplin.data.get ['notes'] {fields: 'title, id, updated_time', order_by: 'updated_time', order_dir: 'DESC', limit: 10, page: 1} 15:07:14: PluginRunner: Got message (3): joplin.data.get ['resources'] {fields: 'title, id, updated_time', order_by: 'updated_time', order_dir: 'DESC', limit: 10, page: 1} 15:07:14: PluginRunner: Got message (3): joplin.data.get ['tags'] {fields: 'title, id, updated_time', order_by: 'updated_time', order_dir: 'DESC', limit: 10, page: 1} 15:07:14: PluginRunner: Got message (3): joplin.settings.value fileLogLevel 15:07:14: PluginRunner: Got message (3): joplin.settings.value createSubfolder 15:07:14: PluginRunner: Got message (3): joplin.settings.value path 15:07:14: PluginRunner: Got message (3): joplin.settings.globalValue profileDir 15:07:14: PluginRunner: Got message (3): joplin.settings.value backupRetention 15:07:14: PluginRunner: Got message (3): joplin.settings.value zipArchive 15:07:14: PluginRunner: Got message (3): joplin.settings.value compressionLevel 15:07:14: PluginRunner: Got message (3): joplin.settings.value singleJexV2 15:07:14: PluginRunner: Got message (3): joplin.settings.value exportFormat 15:07:14: PluginRunner: Got message (3): joplin.settings.value execFinishCmd 15:07:14: PluginRunner: Got message (3): joplin.settings.value backupPlugins 15:07:14: PluginRunner: Got message (3): joplin.settings.value backupSetName 15:07:14: PluginRunner: Got message (3): joplin.settings.value usePassword 15:07:14: PluginRunner: Got message (3): joplin.settings.setValue password password 15:07:14: PluginRunner: Got message (3): joplin.settings.setValue passwordRepeat repeat12 ````
github-actions[bot] commented 8 months ago

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.

github-actions[bot] commented 6 months ago

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.