joplin-plugin-enhancement icon indicating copy to clipboard operation
joplin-plugin-enhancement copied to clipboard

Front matter replaced by empty table

Open graphit0 opened this issue 1 year ago • 5 comments

Thank you for this amazing plugin, it's got many great features. In general am very happy with it but during testing of this plugin few things popped out

Description

front matter block is replaced by table -- front matter data is lost

Settings for the plugin

image

Steps

  1. paste provided front matter in any note
  2. place cursor into the next line following the front matter block

demo

https://github.com/SeptemberHX/joplin-plugin-enhancement/assets/44114323/5ee81a1f-b218-4a88-a7ea-8a3faba843f6

Environment

Joplin 2.11.4 (prod, linux) same behaviour in 2.12.4 as well

Client ID: 13d35302ccf3481684f87472953c66ef Sync Version: 3 Profile Version: 42 Keychain Supported: No

Revision: 201c7d8

Enhancement: 1.2.1

logs

/home/trex/.config/joplin-desktop/cache/com.septemberhx.Joplin.Enhancement/driver/codemirror/index.js:14 ===> table type: simple
/home/trex/.config/joplin-desktop/cache/com.septemberhx.Joplin.Enhancement/driver/codemirror/index.js:14 (5) ['---', 'color: ', '  label: Select color of the block', '  type: dropdown(AntiqueWhite, Azure, DarkSalmon, …, CornflowerBlue, SkyBlue, Turquoise, LightGreen)', '---']

front matter used

---
color: 
  label: Select color of the block
  type: dropdown(AntiqueWhite, Azure, DarkSalmon, LightCoral, CornflowerBlue, SkyBlue, Turquoise, LightGreen)
---

Notes

  • behaviour persists regardless (on or off) of the settings Enable table formatter in editor and Enable front matter markdown-it rule
  • since Template plugin for Joplin uses front matter to encode templates, viewing template with Enhancement plugin turned on will erase template's config
  • Temporary workaround is to leave extra blank line before the closing set of hyphens "---" in front matter config

graphit0 avatar Jul 11 '23 14:07 graphit0

@SeptemberHX While this could be a separate issue, this is related enough to this one that I feel I should point it out here.

The default markdown rendering in the editor makes the line before the end of the front matter into a header of some sort:

image

I've just been adding an extra line break, but I wish I didn't have to.

God-damnit-all avatar Jul 18 '23 20:07 God-damnit-all

@ImportTaste hyphens going after text rendered as header2 is expected behaviour and is part of markdown syntax -- therefore it works this way in any markdown application regardless of enhancement plugin

here's example rendered by github

Lorem
---

Lorem

graphit0 avatar Jul 19 '23 11:07 graphit0

Temporary workaround is to leave extra blank line before the closing set of hyphens "---" in front matter config

Example

---
Lorem
[blank line]
---

Additionally, in order to safely edit front matters config, be sure to do it in WYSIWYG/Rich text editor

graphit0 avatar Aug 02 '23 09:08 graphit0

Temporary workaround is to leave extra blank line before the closing set of hyphens "---" in front matter config

Example

---
Lorem
[blank line]
---

Additionally, in order to safely edit front matters config, be sure to do it in WYSIWYG/Rich text editor

I'm doing that already, I'm just hoping it won't be necessary to keep doing that in the future.

God-damnit-all avatar Aug 03 '23 00:08 God-damnit-all

By trial and error, the behavior is caused by "Render markdown table to editable table in markdown editor From Zettlr" setting; unchecking it eliminates the defect.

Since it's an upstream plugin from zettlr, it would be interesting to see if this behaviour is present in Zettlr itself.

graphit0 avatar Aug 04 '23 09:08 graphit0