RiFi2k / format-html-in-php

Basically this vscode extension uses all your standard configurations for html formatting, and your standard configurations for format on save, etc. It more or less works exactly how vscode should already work as it pertains to HTML in PHP files.
The Unlicense
33 stars 6 forks source link

I am having troubles with the indentation #44

Open marelyns opened 4 years ago

marelyns commented 4 years ago

Hi there :) I am having some problems with the indentation and I don't know if I am doing something wrong in my settings. I do not understand why the opening and ending declaration of php <?phpand ?> after formatting have a wrong position.

Thank you in advance and please see the example following:

This is the desired formatting code:

<!DOCTYPE html>
<?php
// Website-Sprache 
?>
<html lang="<?php echo $_SESSION['user_lang']; ?>">
  <head>
<!-- Copyright 2020 -->
<?php
// Zeichensatz
?>
    <meta charset="utf-8">
<?php
// Erforderlich
?>
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php
// Seiten-Titel
?>
    <title><?php echo C_page_title; ?></title>
<?php
// Einbindung
?>
    <link href="styles/main.css" rel="stylesheet" />
<?php
// Einbindung 
?>
    <script src="js/head.js"></script>
  </head>

And I get this code after formatting with the extension: (I don't want)

<!DOCTYPE html> <?php
// Website-Sprache 
?> <html lang="<?php echo $_SESSION['user_lang']; ?>">

    <head>
<!-- Copyright 2020 --><?php
// Zeichensatz 
?>
        <meta charset="utf-8"> <?php
// Erforderlich 
?>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"> <?php
// Seiten-Titel
?> <title><?php echo C_page_title; ?></title> <?php
// Einbindung
?>
        <link href="styles/main.css" rel="stylesheet" /> <?php
// Einbindung 
?> <script src="js/head.js"></script>
    </head>