obsidian-shiki-plugin icon indicating copy to clipboard operation
obsidian-shiki-plugin copied to clipboard

After enabling the plug-in, PDF export will output will output Front Matter.

Open bcdax110 opened this issue 1 year ago • 1 comments

  • [x] The Plugin is up to date
  • [x] Obsidian is up to date

Describe the bug After enabling the plug-in, PDF export will output will output Front Matter.

To Reproduce Steps to reproduce the behavior:

  1. Install and enable this plugin.
  2. Open the file containing Front Matter.
  3. excute command "Export to PDF..."

Expected behavior As before enabling the plugin, there will be no output of the Front Matter yaml

Screenshots md file: Clip_2024-05-15_22-00-14 PDF file (Not Enable this plugin): Clip_2024-05-15_22-00-44 PDF file (Enable this plugin): Clip_2024-05-15_22-01-23

Occurs on

  • [x] Windows
  • [ ] macOS
  • [ ] Linux
  • [ ] Android
  • [ ] iOS

Plugin version 0.3.2

Additional context Newly created Obsidian Vault with only this plugin enabled.

bcdax110 avatar May 15 '24 14:05 bcdax110

Thanks for creating this issue, I had the same problem and couldn't figure out why this was occurring.

The YAML is output with the same styling as applied to codeblocks: image

FeralFlora avatar Oct 16 '24 10:10 FeralFlora

this is still there and quite annoying. Any chance to fix this?

LFSaw avatar Aug 13 '25 11:08 LFSaw

I think you can exclude properties from the highlighted "languages", and that fixes it.

Image

cncastillo avatar Aug 13 '25 23:08 cncastillo

Thanks, @cncastillo ! just excluding 'properties' helps. Don't forget to Reload Highlighter, though.

This should go into the documentation and IMHO properties should be an excluded language by default. It took me the better part of 30min to find out which plugin was the culprit for this behaviour.

LFSaw avatar Aug 14 '25 05:08 LFSaw

I tested this, and it seems like properties does not help, but excluding yaml does. So this does not help with the PDF export, since I don't want to globally disable YAML highlighting.

mProjectsCode avatar Aug 26 '25 21:08 mProjectsCode

Though it seems like I found a fix for the issue. I will test it a bit more, and if it works correctly, I will release a fix.

if (el.parentElement?.classList.contains('mod-frontmatter')) {
    return;
}

mProjectsCode avatar Aug 26 '25 21:08 mProjectsCode

Should be fixed in 0.5.1

mProjectsCode avatar Aug 26 '25 22:08 mProjectsCode