Skip to content

Commit

Permalink
Add the RawScript helper
Browse files Browse the repository at this point in the history
  • Loading branch information
willoma committed Oct 9, 2024
1 parent d054409 commit 33704bc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions helpers.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package gomplements

import (
"github.com/maragudk/gomponents"
"github.com/maragudk/gomponents/html"
)

Expand All @@ -19,3 +20,8 @@ type ID string
func ImgSrc(src string, children ...any) Element {
return Elem(html.Img, html.Src(src), children)
}

// RawScript creates a <script> element, with the provided content as a script, unmodified.
func RawScript(script string) Element {
return Script(gomponents.Raw(script))
}

0 comments on commit 33704bc

Please sign in to comment.