obsidian-code-block-enhancer
obsidian-code-block-enhancer copied to clipboard
Bug: Line numbers do not line up accurately with actual code lines.
I'm not sure if this is something new or it has always been a problem, but I have used this excellent plugin for a while and have only just now noticed the problem. Anyway, in Preview mode, the line numbers are slightly below the lines they refer to. See https://cln.sh/nmZLl9+.
I am having the same problem. In my tests, it does not seems to be styling from anything else. The bare plugin alone has this issue.
Thank you
seeing this issue too.
by the time you get to the bottom of the code block, there are 4 or 5 lines that do not appear to have line numbers
I presume that this can be fixed by modifying the line spacing/font sizing of the actual code, but I am unsure how to resolve this myself.
Maybe this might help someone.
I changed line 59 in style.css
from:
top: 1em;
to:
top: 0.5em;
Screenshots of ~/path_to/.obsidian/plugins/obsidian-code-block-enhancer/styles.css
taken from Obsidian showing passable/usuable/close enough-able line numbers.


@berty-b Thanks, it works fine! But language name is hidden...
@hkcomori
I commented line 27
in style.css
from:
position: absolute;
to:
/* position: absolute; */
Screenshot of ~/path_to/.obsidian/plugins/obsidian-code-block-enhancer/styles.css
taken from Obsidian showing language name at the bottom.
@berty-b Thanks for the suggestion, but I no longer see the problem with misaligned line numbers. It must have been fixed somewhere along the way.