pre tag disregards spaces at beginning of line

Homepage Forums Pro Support Forum Blackoot Pro Blackoot Pro Support pre tag disregards spaces at beginning of line

pre tag disregards spaces at beginning of line

This topic contains 4 replies, has 2 voices, and was last updated by  geohei 2 months, 3 weeks ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #21460
    pre tag disregards spaces at beginning of line

    geohei
    Participant

    Hi.

    I don’t know whether this changed during a WP update or Blackoot update.

    I have a couple of pages which use the pre tag extensively. Some lines start with spaces. These spaces seem to be ignored since some time, so that the line starts with the first text, which should actually only start somewhat more to the right of the left page border.

    Other themes seem to to this properly as desired.

    Any ideas?

    Thanks,

    • This topic was modified 3 months ago by  geohei.
    #21470
    Reply to: pre tag disregards spaces at beginning of line

    iceable
    Keymaster
    Support
    Happy with my help?
    Buy me a beer!

    Hi, and apologies for the late reply.
    Please try to add this to Custom CSS:

    pre {
    	white-space: pre !important;
    }

    This is set to “pre-line” by default in this theme, setting it to “pre” instead will preserve your space/tabs at the beginning of lines.

    For the record this was introduced in version 1.2.2 (2017-08-25) to fix an issue with overflow outside of pre tag areas.

    #21471
    Reply to: pre tag disregards spaces at beginning of line

    geohei
    Participant

    Hi.

    Thanks again for the answer !!! (no worries for late)
    It works like you describe!

    Also thanks for the background information, but now, this here is back:
    https://www.iceablethemes.com/forums/topic/extend-to-the-right-of-box/

    pre { overflow-x: scroll; }
    … doesn’t seem to work anymore.

    • This reply was modified 2 months, 3 weeks ago by  geohei.
    • This reply was modified 2 months, 3 weeks ago by  geohei.
    • This reply was modified 2 months, 3 weeks ago by  geohei.
    #21475
    Reply to: pre tag disregards spaces at beginning of line

    iceable
    Keymaster
    Support
    Happy with my help?
    Buy me a beer!

    I think adding the “!important” tag will get it to work again:

    pre {
    	white-space: pre !important;
    	overflow-x: scroll !important;
    }

    On a related note, some of your pre tag are quite long, the scrollbar at the bottom is not always obvious at first. To make the fact that some lines are extending beyond the box more clear, you could maybe make the pre box a bit lighter or darker (so the lines that are cut off will stand out and it will be more obvious that the box can scroll).

    For example, this will make pre tags a bit lighter:

    pre {
    	background: rgba( 255, 255, 255, 0.05 );
    }

    Or a bit darker:

    pre {
    	background: rgba( 0, 0, 0, 0.3 );
    }
    #21476
    Reply to: pre tag disregards spaces at beginning of line

    geohei
    Participant

    Sorry (!), but I was wrong with the scrolling not working. Fingertrouble on my side. Even without the “!important”, the scrolling works.

    Thanks for the hint with the background, but I use this already:

    pre {
        background: #111111;
    }

    This makes the pre background darker than the !=pre background.

    Thanks,

    • This reply was modified 2 months, 3 weeks ago by  geohei.
    • This reply was modified 2 months, 3 weeks ago by  geohei.
Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.


PayPal Verified
Secured by PayPal
Secure Credit Card payments powered by Stripe
SiteLock