mirror of
https://github.com/lightpanda-io/browser.git
synced 2025-10-29 23:23:28 +00:00
Merge pull request #1089 from lightpanda-io/fix-datauri
fix data uri scripts
This commit is contained in:
@@ -157,9 +157,10 @@ pub fn addFromElement(self: *ScriptManager, element: *parser.Element) !void {
|
|||||||
if (try parser.elementGetAttribute(element, "src")) |src| {
|
if (try parser.elementGetAttribute(element, "src")) |src| {
|
||||||
if (try DataURI.parse(page.arena, src)) |data_uri| {
|
if (try DataURI.parse(page.arena, src)) |data_uri| {
|
||||||
source = .{ .@"inline" = data_uri };
|
source = .{ .@"inline" = data_uri };
|
||||||
|
} else {
|
||||||
|
remote_url = try URL.stitch(page.arena, src, page.url.raw, .{ .null_terminated = true });
|
||||||
|
source = .{ .remote = .{} };
|
||||||
}
|
}
|
||||||
remote_url = try URL.stitch(page.arena, src, page.url.raw, .{ .null_terminated = true });
|
|
||||||
source = .{ .remote = .{} };
|
|
||||||
} else {
|
} else {
|
||||||
const inline_source = parser.nodeTextContent(@ptrCast(element)) orelse return;
|
const inline_source = parser.nodeTextContent(@ptrCast(element)) orelse return;
|
||||||
source = .{ .@"inline" = inline_source };
|
source = .{ .@"inline" = inline_source };
|
||||||
|
|||||||
Reference in New Issue
Block a user