Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code blocks can cause lockup #3281

Closed
deftdawg opened this issue May 27, 2020 · 3 comments
Closed

Code blocks can cause lockup #3281

deftdawg opened this issue May 27, 2020 · 3 comments
Labels
bug It's a bug desktop All desktop platforms high High priority issues

Comments

@deftdawg
Copy link

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:
```css

```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:

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

```typescript
//  imports: [
```

And this once fixed using the DB method:

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

```typescript
//  imports: [
```
@deftdawg deftdawg added the bug It's a bug label May 27, 2020
@laurent22 laurent22 added desktop All desktop platforms high High priority issues labels May 27, 2020
@laurent22 laurent22 added upstream There's a problem with upstream code. and removed high High priority issues labels May 27, 2020
@laurent22
Copy link
Owner

Reported upstream: markdown-it/markdown-it#676

@puzrin
Copy link

puzrin commented May 27, 2020

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!

@laurent22 laurent22 added high High priority issues and removed upstream There's a problem with upstream code. labels Jun 25, 2020
@laurent22
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug It's a bug desktop All desktop platforms high High priority issues
Projects
None yet
Development

No branches or pull requests

3 participants