mvdkwast / obsidian-copy-as-html

Obsidian plugin: copy document as HTML, including images
MIT License
42 stars 11 forks source link

Front matter is getting copied over when dataview inline variable is also present #28

Open aravindk100 opened 1 year ago

aravindk100 commented 1 year ago

Describe the bug Front matter is getting copied in the final HTML (even with the option selected to ignore front matter) only when there is inline variable using dataview is present. When I try the same steps without inline variables front matter is ignored. The option to enable or disable remove data view metadata lines has no effect.In both cases dataview inline variables still got removed (which is fine by me but does not seem to follow the option)

To Reproduce Steps to reproduce the behavior: Copy document as HTML when document has dataview inline variable.

Expected behavior I expect front matter and dataview inline variables to be removed from the final output

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

mvdkwast commented 11 months ago

Thanks for reporting, I will try to reproduce this. Feel free to provide a minimal document which illustrates the issue, as I'm not very familiar with Dataview inline variables.

mvdkwast commented 11 months ago

This is actually a known short-coming, and documented in the README.

The problem with this is that there are several syntaxes for dataview inline variables, and they are not trivial to extract from the document (if not done right we may remove more than what we want). Also, dataview may update its rules at any time.

So I'm not very keen on implementing this myself. However, if someone wants to tackle this, we could add it as an experimental feature that could be enabled in the settings. Welcoming pull-requests ;)