aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Brúnó Salomon <35275408+bru02@users.noreply.github.com> 2023-06-26 01:48:03 +0200
committerGravatar GitHub <noreply@github.com> 2023-06-25 16:48:03 -0700
commit662335d81aa39dc53b83f2759312ff0ff3a93af2 (patch)
treede4896944d8a92153d317f6d84c93646b928dbd6 /src
parentd8817c2d32a237440a7677622ba351aa95f47c22 (diff)
downloadbun-662335d81aa39dc53b83f2759312ff0ff3a93af2.tar.gz
bun-662335d81aa39dc53b83f2759312ff0ff3a93af2.tar.zst
bun-662335d81aa39dc53b83f2759312ff0ff3a93af2.zip
chore: update lol-html version (#3356)
* chore: update lol-html version * add tests --------- Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Diffstat (limited to 'src')
-rw-r--r--src/bun.js/api/html_rewriter.zig7
m---------src/deps/lol-html0
-rw-r--r--src/deps/lol-html.zig8
-rw-r--r--src/generated_versions_list.zig2
4 files changed, 14 insertions, 3 deletions
diff --git a/src/bun.js/api/html_rewriter.zig b/src/bun.js/api/html_rewriter.zig
index 93a41b095..d09c14e42 100644
--- a/src/bun.js/api/html_rewriter.zig
+++ b/src/bun.js/api/html_rewriter.zig
@@ -1016,6 +1016,9 @@ pub const TextChunk = struct {
.removed = .{
.get = getterWrap(TextChunk, "removed"),
},
+ .lastInTextNode = .{
+ .get = getterWrap(TextChunk, "lastInTextNode"),
+ },
.text = .{
.get = getterWrap(TextChunk, "getText"),
},
@@ -1084,6 +1087,10 @@ pub const TextChunk = struct {
return JSC.JSValue.jsBoolean(this.text_chunk.?.isRemoved());
}
+ pub fn lastInTextNode(this: *TextChunk, _: *JSGlobalObject) JSValue {
+ return JSC.JSValue.jsBoolean(this.text_chunk.?.isLastInTextNode());
+ }
+
pub fn finalize(this: *TextChunk) void {
this.text_chunk = null;
bun.default_allocator.destroy(this);
diff --git a/src/deps/lol-html b/src/deps/lol-html
-Subproject 2eed349dcdfa4ff5c19fe7c6e501cfd68760103
+Subproject 2681dcf0b3e6907111565199df8c43cc9aab7fe
diff --git a/src/deps/lol-html.zig b/src/deps/lol-html.zig
index 1d71e6aa6..9c5345046 100644
--- a/src/deps/lol-html.zig
+++ b/src/deps/lol-html.zig
@@ -393,7 +393,8 @@ pub const Element = opaque {
extern fn lol_html_element_is_removed(element: *const Element) bool;
extern fn lol_html_element_user_data_set(element: *const Element, user_data: ?*anyopaque) void;
extern fn lol_html_element_user_data_get(element: *const Element) ?*anyopaque;
- extern fn lol_html_element_on_end_tag(element: *Element, end_tag_handler: lol_html_end_tag_handler_t, user_data: ?*anyopaque) c_int;
+ extern fn lol_html_element_add_end_tag_handler(element: *Element, end_tag_handler: lol_html_end_tag_handler_t, user_data: ?*anyopaque) c_int;
+ extern fn lol_html_element_clear_end_tag_handlers(element: *Element) void;
pub fn getAttribute(element: *const Element, name: []const u8) HTMLString {
auto_disable();
@@ -502,7 +503,10 @@ pub const Element = opaque {
}
pub fn onEndTag(element: *Element, end_tag_handler: lol_html_end_tag_handler_t, user_data: ?*anyopaque) Error!void {
auto_disable();
- return switch (lol_html_element_on_end_tag(element, end_tag_handler, user_data)) {
+
+ lol_html_element_clear_end_tag_handlers(element);
+
+ return switch (lol_html_element_add_end_tag_handler(element, end_tag_handler, user_data)) {
0 => {},
-1 => error.Fail,
else => unreachable,
diff --git a/src/generated_versions_list.zig b/src/generated_versions_list.zig
index 90bee0b8c..c27f47c83 100644
--- a/src/generated_versions_list.zig
+++ b/src/generated_versions_list.zig
@@ -9,6 +9,6 @@ pub const webkit = "60d11703a533fd694cd1d6ddda04813eecb5d69f";
pub const zig = @import("std").fmt.comptimePrint("{}", .{@import("builtin").zig_version});
pub const zlib = "885674026394870b7e7a05b7bf1ec5eb7bd8a9c0";
pub const tinycc = "2d3ad9e0d32194ad7fd867b66ebe218dcc8cb5cd";
-pub const lolhtml = "2eed349dcdfa4ff5c19fe7c6e501cfd687601033";
+pub const lolhtml = "2681dcf0b3e6907111565199df8c43cc9aab7fe8";
pub const c_ares = "0e7a5dee0fbb04080750cf6eabbe89d8bae87faa";
pub const usockets = "fafc241e8664243fc0c51d69684d5d02b9805134";