Skip to content

Commit

Permalink
fix remaining rendering bug for void elements
Browse files Browse the repository at this point in the history
  • Loading branch information
kristoff-it committed Oct 31, 2024
1 parent 6db4b33 commit 7d61ccc
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
29 changes: 29 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,35 @@ fn setupReleaseStep(

release_step.dependOn(&target_output.step);
}

// wasm
{
const super_wasm_lsp = b.addExecutable(.{
.name = "superhtml",
.root_source_file = b.path("src/wasm.zig"),
.target = b.resolveTargetQuery(.{
.cpu_arch = .wasm32,
.os_tag = .wasi,
}),
.optimize = .ReleaseSmall,
.single_threaded = true,
.link_libc = false,
});

super_wasm_lsp.root_module.addImport("superhtml", superhtml);
super_wasm_lsp.root_module.addImport("lsp", lsp.module("lsp"));
super_wasm_lsp.root_module.addOptions("build_options", options);

const target_output = b.addInstallArtifact(super_wasm_lsp, .{
.dest_dir = .{
.override = .{
.custom = "wasm-wasi-lsponly",
},
},
});

release_step.dependOn(&target_output.step);
}
}

const Version = union(Kind) {
Expand Down
5 changes: 5 additions & 0 deletions editors/vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

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

## [v0.5.2]
- 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.

- Fixed indentation bug when formatting void elements.

## [v0.5.1]
- This is now a web extension that can be used with vscode.dev, etc.

Expand Down
2 changes: 1 addition & 1 deletion editors/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Language Server for HTML and SuperHTML Templates.",
"repository": "https://github.com/kristoff-it/superhtml/",
"publisher": "LorisCro",
"version": "0.5.1",
"version": "0.5.2",
"engines": {
"vscode": "^1.92.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/html/Ast.zig
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,7 @@ pub fn render(ast: Ast, src: []const u8, w: anytype) !void {
}
if (vertical) {
try w.print("\n", .{});
for (0..indentation -| 1) |_| {
for (0..indentation + extra -| 1) |_| {
try w.print(" ", .{});
}
}
Expand Down

0 comments on commit 7d61ccc

Please sign in to comment.