SeptemberHX / joplin-plugin-enhancement

joplin plugin to enhance my daily usage
GNU General Public License v3.0
164 stars 13 forks source link

Front matter replaced by empty table #38

Open graphit0 opened 1 year ago

graphit0 commented 1 year ago

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

God-damnit-all commented 1 year ago

@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.

graphit0 commented 1 year ago

@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 commented 1 year ago

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

God-damnit-all commented 1 year ago

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.

graphit0 commented 1 year ago

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.