• Resolved Chuckie

    (@ajtruckle)


    I have decided to ask this question here because I am using the bbp style pack for the look and feel of my support forum. I am having an issue with a plugin called EnlighterJS.

    Here is an example of this plugin being use with a standard WordPress post. There is nothing wrong with it. All good.

    Here is an example showing code in a public bbPress forum post. You don’t need to register with the forum to see the above.

    The main issue in bbPress is that you can’t see the line numbers on the left. I had tried this additional CSS:

    .EnlighterJS{
       width: auto !important;
       overflow-x: scroll !important;
       word-wrap: normal !important;
    }
    
    .EnlighterJS li{
      white-space: pre !important;
    }
    
    ol.EnlighterJS, ul.EnlighterJS {
      padding-left: 50px !important;
    }
    

    By adding padding of 50px it kind of fixes it in bbPress. But this is not the solution for two reasons:

    • The larger the starting line number, the larger padding would be needed.
    • This styling messes up the regular posts where no padding is required.

    I have come to the conclusion that massaging the padding for the bullet elements is not the answer. Somehow I need to ensure that the EnlighterJS container is all within the bbPress topic/reply whilst at the same time not breaking the look and feel of code samples in normal posts.

    I hope this makes sense. Any advice on what CSS styling to implement is greatly appreciated.

    • This topic was modified 4 years, 2 months ago by Chuckie.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Chuckie

    (@ajtruckle)

    I managed to workout CSS so that only bbPress applies the padding. So one issue resolved.

    But I still have the underlying issue of avoiding the need for padding in the first place. What is different about the container in a normal post v bbPress to cause this?

    Thread Starter Chuckie

    (@ajtruckle)

    I have commented out the additional CSS so that you can see the real issue.

    Normal post shows line numbers.
    BBPress numbers can’t be seen (unless I introduce left padding)

    Thread Starter Chuckie

    (@ajtruckle)

    Think I have solved this:

    #bbpress-forums ol.EnlighterJS > li, ul.EnlighterJS > li {
      margin-left: 40px !important;
    }
    Plugin Author Robin W

    (@robin-w)

    great – glad you are fixed

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Line numbers not visible in bbPress when using EnlighterJS plugin.’ is closed to new replies.