Skip to content

Commit 7d61ccc

Browse files
committed
fix remaining rendering bug for void elements
1 parent 6db4b33 commit 7d61ccc

4 files changed

Lines changed: 36 additions & 2 deletions

File tree

build.zig

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,35 @@ fn setupReleaseStep(
261261

262262
release_step.dependOn(&target_output.step);
263263
}
264+
265+
// wasm
266+
{
267+
const super_wasm_lsp = b.addExecutable(.{
268+
.name = "superhtml",
269+
.root_source_file = b.path("src/wasm.zig"),
270+
.target = b.resolveTargetQuery(.{
271+
.cpu_arch = .wasm32,
272+
.os_tag = .wasi,
273+
}),
274+
.optimize = .ReleaseSmall,
275+
.single_threaded = true,
276+
.link_libc = false,
277+
});
278+
279+
super_wasm_lsp.root_module.addImport("superhtml", superhtml);
280+
super_wasm_lsp.root_module.addImport("lsp", lsp.module("lsp"));
281+
super_wasm_lsp.root_module.addOptions("build_options", options);
282+
283+
const target_output = b.addInstallArtifact(super_wasm_lsp, .{
284+
.dest_dir = .{
285+
.override = .{
286+
.custom = "wasm-wasi-lsponly",
287+
},
288+
},
289+
});
290+
291+
release_step.dependOn(&target_output.step);
292+
}
264293
}
265294

266295
const Version = union(Kind) {

editors/vscode/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
All notable changes to the "super" extension will be documented in this file.
44

5+
## [v0.5.2]
6+
- Starting from this release, a WASM-WASI build of SuperHTML is available on GitHub (in the Releases section) in case editors other than VSCode might watnt to bundle a wasm build of SuperHTML.
7+
8+
- Fixed indentation bug when formatting void elements.
9+
510
## [v0.5.1]
611
- This is now a web extension that can be used with vscode.dev, etc.
712

editors/vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Language Server for HTML and SuperHTML Templates.",
55
"repository": "https://github.com/kristoff-it/superhtml/",
66
"publisher": "LorisCro",
7-
"version": "0.5.1",
7+
"version": "0.5.2",
88
"engines": {
99
"vscode": "^1.92.0"
1010
},

src/html/Ast.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ pub fn render(ast: Ast, src: []const u8, w: anytype) !void {
770770
}
771771
if (vertical) {
772772
try w.print("\n", .{});
773-
for (0..indentation -| 1) |_| {
773+
for (0..indentation + extra -| 1) |_| {
774774
try w.print(" ", .{});
775775
}
776776
}

0 commit comments

Comments
 (0)