WordPress.org

Ready to get started?Download WordPress

Forums

Embed GitHub Gist
Indentation not working (6 posts)

  1. bennuttall
    Member
    Posted 1 year ago #

    If I embed a gist using the github gist embed code, the indentation is shown as expected. Using this plugin, it embeds gists lose their indentation.

    http://wordpress.org/extend/plugins/embed-github-gist/

  2. bennuttall
    Member
    Posted 1 year ago #

    Apologies - I can confirm this is a CSS rule causing this bug on my site. Will try to narrow it down and post a fix if anyone has the same issue maybe it will help.

    /withdrawn

  3. Ulrich
    Member
    Posted 1 year ago #

    It has something to do with

    pre {
        white-space: pre-wrap;
    }

    The problem is that if the gist loads with the css like above then it shows the indent and then you could change to...

    pre {
        white-space: nowrap;
    }

    ...but if you have the nowrap before the gist loads you have the code not wrapping but no indention. I am not sure where the problem lies.

  4. vigilantetheory
    Member
    Posted 1 year ago #

    I've run into this same issue. I tried changing the CSS pre tag definition to no avail.
    Were you able to find the CSS issue?

  5. bennuttall
    Member
    Posted 1 year ago #

    I commented a few lines out of my theme's stylesheet as follows:

    pre {
    padding: 10px;
    /*white-space: pre;
    white-space: pre-wrap;
    white-space: pre-line;*/
    word-wrap: break-word;
    }

    Got one similar issue though - the line number margin varies in width according to the content of the code. Any ideas?

    See: http://bennuttall.com/comprehension-in-python/

  6. Ulrich
    Member
    Posted 1 year ago #

    I came across this today. I have not been able to test it yet.
    http://davidwalsh.name/tab-size

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic