code does not keep layout

  • Betroffene App
    WoltLab Suite Core

    When pasting code into the editor it looks great. But once you submit the layout is not kept as it should be. You can see an example here

    Apache Configuration
    # BEGIN WordPress<IfModule mod_rewrite.c>RewriteEngine OnRewriteBase /RewriteRule ^index\.php$ - [L]RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /index.php [L]</IfModule># END WordPress

    I simply opened an htaccess file using geditor (basic text editor found in Linux) and pasted the context within. Which is obviously really simple. It looked great within the editor but once you submit your post the code no longer keeps the layout and word wrap seems to take over. I am of course using the code command found in the editor.

    Love is love. * Liebe ist Liebe.

    Meine Muttersprache ist Japanisch. Ich schreibe in Englisch, um ins Deutsche zu übersetzen. Bitte haben Sie Geduld mit mir. https://www.deepl.com/translator

  • Did you insert the code block and then pasted into it, or did you paste the code and then wrapped it using the code button? Also, which browser- and version are you using?

    I pressed the code button on the editor and pasted it inside the code box (or as you call it the code wrapper).

    Apache Configuration
    # BEGIN WordPress<IfModule mod_rewrite.c>RewriteEngine OnRewriteBase /RewriteRule ^index\.php$ - [L]RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule . /index.php [L]</IfModule># END WordPress

    Here (above) is me doing it backwards as you suggested. Pasting the code first and then highlighting the text, then pressing the code button. Which means I now have done it both ways.

    I am using Firefox v58.0.2 and here is my user agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:58.0) Gecko/20100101 Firefox/58.0

    Love is love. * Liebe ist Liebe.

    Meine Muttersprache ist Japanisch. Ich schreibe in Englisch, um ins Deutsche zu übersetzen. Bitte haben Sie Geduld mit mir. https://www.deepl.com/translator

    • Offizieller Beitrag

    It appears to be working just fine in Firefox 58.0.2 on Windows, tried pasting from various editors. It looks like that the code was pasted from a .htaccess, would you be so kindly to attach it here, so that I can use the same exact source in order to reproduce it?

    PS: Don't take my "reverse way" as a suggestion, it is actually the least recommended method.

  • It appears to be working just fine in Firefox 58.0.2 on Windows, tried pasting from various editors. It looks like that the code was pasted from a .htaccess, would you be so kindly to attach it here, so that I can use the same exact source in order to reproduce it?

    PS: Don't take my "reverse way" as a suggestion, it is actually the least recommended method.

    Attached as requested are both htaccess files I have been working with. One is for WordPress and the other is for WoltLab. I have been trying to merge them into a single file and they do not seem to be compatible with one another. When I inquired about that here that is how I discovered the bug with the code not keeping the layout after submitted in a post. WordPress and WoltLab rewrite rules incompatable?

  • Alexander Ebert 20. Februar 2018 um 11:55

    Hat das Label Rückmeldung erforderlich hinzugefügt.
  • It appears to be that this is not a general issue, at least on Windows it works using Notepad++. Which editor are you using to copy the contents into the clipboard?

    I am using Ubuntu Linux and the editor of choice is gEdit which is the Linux equivalence of notepad (and also the default text editor in most major Linux distros). I have already ruled out the editor since this would be a significant bug to report in the Linux world and found that this issue only repeats here.

    Love is love. * Liebe ist Liebe.

    Meine Muttersprache ist Japanisch. Ich schreibe in Englisch, um ins Deutsche zu übersetzen. Bitte haben Sie Geduld mit mir. https://www.deepl.com/translator

  • Matthias Schmidt 20. Februar 2018 um 18:49

    Hat das Label von Rückmeldung erforderlich auf Ist kein Fehler geändert.
    • Offizieller Beitrag

    That's really strange, because from what I can tell - at least based off the short description - it is supposed to stop pages from messing with your pasting ability.

    Actually, I have modified the editor to intercept the paste event in order to extract the pasted data directly, without having to deal with the highly inconsistent result across different browsers. In particular, Firefox sometimes pastes plain text (such as copied from a text file) using simple line breaks, but pretends that the result is true HTML (spoilers, it isn't!).

    Besides that, thank you for your testing, I've put that addon on my list and I will try it out to see what causes this sort of interference, maybe I can find a way to make it work.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!