plugin-php icon indicating copy to clipboard operation
plugin-php copied to clipboard

tab formation and inline

Open alexander-akait opened this issue 7 years ago • 4 comments

Prettier 1.14.3

PHP Plugin 0.9.0

# Options (if any):
--single-quote

Input:

function wp_admin_bar_header()
{
	?>
<style type="text/css" media="print">#wpadminbar { display:none; }</style>
	<?php
}

Output:

function wp_admin_bar_header()
{
    ?>
<style type="text/css" media="print">#wpadminbar { display:none; }</style>
	<?php
}

Expected behavior:

function wp_admin_bar_header()
{
    ?>
<style type="text/css" media="print">#wpadminbar { display:none; }</style>
    <?php
}

alexander-akait avatar Jan 28 '19 14:01 alexander-akait

I think it is not bug, we should not modify inline node content (in theory we can break code if will change content), so it is expected, but looks really ugly, need discussion about this

alexander-akait avatar Jan 28 '19 14:01 alexander-akait

In my opinion, I would suggest keeping it on the same level or one level higher as the rest of the code. I haven't had any case where it breaks the content of the site (not tested old browsers). This would make it better to read and more beautiful.

In my setup the behavior is:

function wp_admin_bar_header()
{
  ?>
    <style type="text/css" media="print">#wpadminbar { display:none; }</style>
  <?php
}

and....

<?php else : ?>
  <jdoc:include type="component" />
<?php endif; ?>

muuvmuuv avatar Feb 26 '19 07:02 muuvmuuv

@muuvmuuv can you describe what you have and what you expected with examples, thanks

alexander-akait avatar Feb 26 '19 10:02 alexander-akait

Also don't forget we can't changes something in inline node, because it can break app (changing inline is not safe)

alexander-akait avatar Feb 26 '19 10:02 alexander-akait