stefanopagliari / bibnotes

360 stars 30 forks source link

Irregularities when applying custom styling to highlight chains #42

Closed MichaBrugger closed 2 years ago

MichaBrugger commented 2 years ago

As discussed earlier I found some irregularities in the application of highlight- and comment styling:

Highlights

Issue: As far as I can tell these things are only related to the append highlight (using the '+' sign) setting. When appending comments, everything set in the custom text settings (see ref 1) are applied fully to the leading comment (including the 'after' part) and half (only the 'after' part) to every following comment in the chain. This can be especially problematic in the context of custom styling since only the closing part of the styling are added (ref 2 and 3).

Possible Solution: There are two obvious options: A) The whole comment chain is treated as one comment, thus only receiving one opening and one closing part or B) Every link in the chain is receiving both an opening and closing part. I personally would prefer B) since it's more flexible and would also work when, for example, one link in the chain is a different highlight colour, etc.

I also found a little bug with comments where they sometimes are styled and sometimes not, depending (from what I saw) on the length of the comment. But I'll first see if I can solve that by myself and open a separate issue if necessary.

ref 1: Custom settings image

In case anybody is wondering: The missing part yellow"> is applied depending on the highlight colour. The whole thing is applying highlightr (another plugin) styling. image

ref 2: Output in Live Preview image

ref 3: Output in Source mode image

stefanopagliari commented 2 years ago

I've merged your code into the main. Thanks for fixing this