Hey guys,
I have two templates:
- InitialDummies.leaf:
<!DOCTYPE html>
<html>
<head>
<style>
th, td { padding: 0 15px; }
</style>
</head>
<body>
<table>
<thead>
<tr>
<th>Component ID</th>
<th>DummyModel1</th>
<th>DummyModel2</th>
</tr>
</thead>
<tbody>
#for(component in components):
#extend("DummyComponent")
#endfor
</tbody>
</table>
<script src="/mist.js"></script>
</body>
</html>
- DummyComponent.leaf:
<tr mist-component="DummyComponent" mist-id="#(component.dummymodel1.id)">
<td>#(component.dummymodel1.id)</td>
<td>#(component.dummymodel1.text)</td>
<td>#(component.dummymodel2.text2)</td>
</tr>
Here is my http endpoint:
app.get("DummyComponents")
{ request async throws -> View in
let context = // ...
return try await request.view.render("InitialDummies", context)
}
The problem (if you want to call it that....) is that this is the final HTML output of the leaf template:
<!DOCTYPE html>
<html>
<head>
<style>
th, td { padding: 0 15px; }
</style>
</head>
<body>
<table>
<thead>
<tr>
<th>Component ID</th>
<th>DummyModel1</th>
<th>DummyModel2</th>
</tr>
</thead>
<tbody>
<tr mist-component="DummyComponent" mist-id="9758DFBB-2687-4089-AEB5-D839DB620DB6">
<td>9758DFBB-2687-4089-AEB5-D839DB620DB6</td>
<td>leaf</td>
<td>client</td>
</tr>
</tbody>
</table>
<script src="/mist.js"></script>
</body>
</html>
As you can see the here:
<tr mist-component="DummyComponent" mist-id="9758DFBB-2687-4089-AEB5-D839DB620DB6">
<td>9758DFBB-2687-4089-AEB5-D839DB620DB6</td>
<td>leaf</td>
<td>client</td>
</tr>
The first line of the extended template is indented correctly, but the rest has wrong indentation.
Does anybody know if I just have to live with this? Or is there something im doing wrong?
Thanks!