EnlighterJS / EnlighterJS

:high_brightness: an open source syntax highlighter written in pure javascript
https://enlighterjs.org/
Mozilla Public License 2.0
1.03k stars 214 forks source link

Problem with styling around enlighter block #198

Closed oleg-dk closed 2 years ago

oleg-dk commented 2 years ago

There is the problem in styling page around enlighter block. It has margin under it: Firefox_Screenshot_2022-08-10T16-12-21 116Z it may be ok… but if i want the text to go right behind it, for example in case:

To see the privileges, enter the command: SHOW GRANTS FOR bitrix0@localhost; where instead of bitrix0 you need to specify the username, and instead of localhost – the hostname.

i fail to do it, because in html dom enlighter div-tag stands before the original pre-tag Firefox_Screenshot_2022-08-10T16-25-34 416Z so i even can't slyle it with css rule .enlighter-origin.no-bottom-margin + .enlighter-default { margin-bottom: 0; }

My sugesstion is to add enlighter div-tag after original pre-tag, so we can style bottom-margin. Or think about a way of forwarding classes from original pre-tag to enlighter div-tag.

AndiDittrich commented 2 years ago

if i understand your issue correctly: you want to remove the margin from specific blocks ? there are 2 solutions available

  1. create a custom theme
  2. enable retainCssClasses option to copy all classes of the pre wrapper to the enlighter codeblocks. this allows you to add a custom class which removes the margin
oleg-dk commented 2 years ago

Yep, thanks. 2nd is just what i need.