Joplin: Code blocks can cause lockup

Created on 27 May 2020  路  3Comments  路  Source: laurent22/joplin

Environment

Joplin 1.0.216 (prod, darwin)
Client ID: 6f19d2068d784848aa561b4780922135
Sync Version: 1
Profile Version: 29
Revision: 4eb680d (master)

Steps to reproduce

  1. Create a document within Joplin using the old editor/view layout with the following content:


```typescript
[
  1. Done

Joplin will be locked, the menus will still open, but nothing will work.

Reopening Joplin will result in same behaviour as the current document is the first thing to open.

Describe what you expected to happen

Would expect UI to still be responsive

Workaround

I discovered this while adding a css code block to a large document, as soon as I opened the block, Joplin froze.

To workaround the problem:

  1. brew cask install db-browser-for-sqlite
  2. Force kill Joplin
  3. Open ~/.config/joplindev-desktop/database.sqlite (open ~/.config/joplindev-desktop/ in terminal, and then double-click on the DB.
  4. Open the notes table, find the body field of document, add closing ``` to offending section
  5. Hit the Apply button
  6. Cmd + Save, to write the DB
  7. Open Joplin and everything should be okay.

In my specific case the doc looked like this before I fixed it:


@import '~material-design-icons/iconfont/material-icons';

```typescript
//  imports: [

And this once fixed using the DB method:


@import '~material-design-icons/iconfont/material-icons';
//  imports: [
bug desktop high

All 3 comments

This problem is caused not by markdown-it itself, but by optional third-party code highlighter.

If you upgrade highlight.js 9 => 10, that helps. Note, v10 is breaking release (with some languages rename and other changes).

Unfortunately, i can guarantee "no serious bugs" only for standalone markdown-it, not for highlighter. I'd recommend reduce list of supported languages to minimal possible set, if you can.

PS. Thank you for report!

Thanks for the info @puzrin, installing hljs 10 indeed fixed the issue!

Was this page helpful?
0 / 5 - 0 ratings