diff --git a/src/embed.odin b/src/embed.odin
index 169652d..d12216f 100644
--- a/src/embed.odin
+++ b/src/embed.odin
@@ -360,6 +360,8 @@ detect_embed_type :: proc(url: string) -> string {
".cpk",
".film":
return "video"
+ case "js", "javascript":
+ return "script"
case:
return "iframe"
}
@@ -375,6 +377,8 @@ parse_type_hint :: proc(type_hint: string) -> string {
return "video"
case "f", "iframe", "frame":
return "iframe"
+ case "s", "script", "js", "javascript":
+ return "script"
case:
return ""
}
diff --git a/src/html.odin b/src/html.odin
index eb226e0..c1851bd 100644
--- a/src/html.odin
+++ b/src/html.odin
@@ -311,6 +311,11 @@ print_html :: proc(token: ^Token) {
fmt.printf("", url)
}
+ case TokenType.Script:
+ if url, ok := token.value.(string); ok {
+ fmt.printf("", url)
+ }
+
case TokenType.BreakLine:
fmt.print("
\n")
diff --git a/src/main.odin b/src/main.odin
index fdc9e14..9cf2c14 100644
--- a/src/main.odin
+++ b/src/main.odin
@@ -83,6 +83,8 @@ print_token :: proc(token: ^Token, depth: int = 0) {
type_str = "Video"
case TokenType.Iframe:
type_str = "Iframe"
+ case TokenType.Script:
+ type_str = "Script"
}
value_str := ""
diff --git a/src/parser.odin b/src/parser.odin
index 98a051c..c278a2c 100644
--- a/src/parser.odin
+++ b/src/parser.odin
@@ -38,6 +38,7 @@ TokenType :: enum {
Audio,
Video,
Iframe,
+ Script,
}
TokenValue :: union {
@@ -610,6 +611,8 @@ parse_embeds :: proc(token: ^Token) {
embed_token_type = .Audio
} else if e_type == "video" {
embed_token_type = .Video
+ } else if e_type == "script" {
+ embed_token_type = .Script
} else {
embed_token_type = .Iframe
}