laravel-page-speed icon indicating copy to clipboard operation
laravel-page-speed copied to clipboard

Removes whitespaces from textboxes

Open marktopper opened this issue 7 years ago • 5 comments

It seems that the RenatoMarinho\LaravelPageSpeed\Middleware\CollapseWhitespace middleware trims whitespaces from inside a <textarea></textarea> input.

Detailed description

Lets say you have a textbox with the following:

<?php
    echo "Hello world!";
?>

comes out as

<?phpecho "Hello world!";?>

This seems like an issue for me, maybe it could become possible to disable this for textarea's?

Context

For example when having a textarea where you want the output to be formatted correctly, like my PHP example from above.

Your environment

  • PHP v7.1.8
  • MacOS Sierra v10.12.6
  • Package v1.8.1

marktopper avatar Oct 19 '17 10:10 marktopper

I know this is an old issue, and a little surprised its not been raised by many others, so maybe I am doing something wrong / strange.

Similarly to the above, anything that looks a little bit like this (in my case through a formatter):

<span
  id="some-id"	
  class="some-class"
  some-key="some-value">
</span>

Appears to result in: <spanid="some-id"class="some-class"some-key="some-value"></span>

whiteboxcode avatar Oct 25 '20 19:10 whiteboxcode

Any update regarding this issue ?.

I am also facing issue with tag.

tansukhrathod avatar Feb 17 '21 08:02 tansukhrathod

I'm also facing this issue when trying to show snippets of code inside <pre></pre> tags. All the code is collapsed into a single line.

mchristie avatar Sep 16 '21 20:09 mchristie

@mchristie I have the same issue. did you solve this?

hosseinkaramii avatar Jan 08 '22 15:01 hosseinkaramii

@mchristie @marktopper @joaorobertopb I have the same issue. code

I'm also facing this issue when trying to show snippets of code inside <pre></pre> tags. All the code is collapsed into a single line.

wwwustafa avatar Jan 12 '22 01:01 wwwustafa