← Back to team overview

nxhtml team mailing list archive

[Question #43320]: Problem with formatting of PHP + HTML

 

New question #43320 on nXhtml:
https://answers.launchpad.net/nxhtml/+question/43320

I am using emacs  22.2.1, with php-mode 1.4.1a-nxhtml and nXhtml 1.52.  When I create a file as follows:
-----------------
<table>
  <tr>
    <td>
      <table>
        <tr>
          <td>Hello</td>
        </tr>
        <?php
        
for ($i=1;$i<5; $i++) {
  if (1) {
    echo "<tr><td>foobar</td></tr>";
  }
  if (1) {
    if (1) {
      if (1) {
        ?>
        <tr>
          <td>
            <p>the brace below (should have 2 spaces in front of it!</p>
          <td>
        </tr>
        <?php
      }
    }
  }
  $foo = "test".bar;
  for ($i=1;$i<5; $i++) {
    if () {
    }
  }
}
        ?>
      </table>
    </td>
  </tr>
</table>
--------------------------
and what I get when indenting using nxhtml-mumamo mode is:
--------------------------
<table>
  <tr>
    <td>
      <table>
        <tr>
          <td>Hello</td>
        </tr>
<?php

for ($i=1;$i<5; $i++) {
  if (1) {
    echo "<tr><td>foobar</td></tr>";
  }
  if (1) {
    if (1) {
      if (1) {
?>
   <tr>
     <td>
       <p>the brace below (should have 2 spaces in front of it!</p>
     <td>
   </tr>
<?php
}
}
}
$foo = "test".bar;
for ($i=1;$i<5; $i++) {
  if () {
  }
}
}
?>
   </table>
    </td>
  </tr>
</table>
--------------------------
i.e. the depth of indenting is lost from one chuck of PHP to the other and one chunck of HTML to the other. Is this what other people get, or have I configured emacs incorrectly?



-- 
You received this question notification because you are a member of
nXhtml, which is an answer contact for nXhtml.