l1xnan / obsidian-better-export-pdf

Obsidian PDF export enhancement plugin
MIT License
240 stars 13 forks source link

[small bug] Custom styles applied to <strong> and <em> are getting reset to their defaults #219

Closed AdamFipke closed 1 month ago

AdamFipke commented 1 month ago

I have some custom styles that change the colour of **bold** and *italic* text to orange.

This works fine in obsidan's default "export to pdf" feature (picture below) image

However, when using this plugin, these colours are removed (picture below). image

Though, these styles can be re-applied by using the custom CSS. image image

AdamFipke commented 1 month ago

update: I thought that using the custom CSS wouldn't work, but it just turns out i was using CSS wrong and applied the rgb value in the wrong way. I have updated the issue accordingly.

So, the severity of this issue isn't nearly as big as i thought it was, and now it's only a minor inconvenience to re-apply the proper CSS

l1xnan commented 1 month ago

First, make sure that the CSS code snippet is enabled by default; otherwise, you'll need to select it within the export modal. Then, you can enable Debug mode to see which CSS snippet is actually taking effect. image

AdamFipke commented 1 month ago

Oh I see that's what the debug button does!

Ah hmm it seems like obsidian's default stylesheet (?) is overwriting any set --bold-color image

Disabling this line makes it appear properly image This is where the colour is defined. image

This might just be a weird interaction between the Border theme I use and this plugin

Anyways yeah it was pretty easy to fix by just using a custom CSS stylesheet for exporting, i'll close the issue since this is probably a rare, inconsequential bug and not worth investigating