Trust route.CaptchaWidget markup in plugin HTML output
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
parent
1a8347a9e5
commit
bd55930870
@ -468,7 +468,7 @@ func (c *htmlChecker) safeCall(call *ast.CallExpr) bool {
|
|||||||
|
|
||||||
// trustedHTMLRenderers are host and library methods that return sanitized
|
// trustedHTMLRenderers are host and library methods that return sanitized
|
||||||
// HTML: the pluginsdk content service's BlockNote renderer and bluemonday.
|
// HTML: the pluginsdk content service's BlockNote renderer and bluemonday.
|
||||||
var trustedHTMLRenderers = map[string]bool{"BlockNoteToHTML": true, "Sanitize": true}
|
var trustedHTMLRenderers = map[string]bool{"BlockNoteToHTML": true, "Sanitize": true, "CaptchaWidget": true}
|
||||||
|
|
||||||
func stringOr(e ast.Expr) string {
|
func stringOr(e ast.Expr) string {
|
||||||
s, _ := stringLit(e)
|
s, _ := stringLit(e)
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import (
|
|||||||
|
|
||||||
"git.dev.alexdunmow.com/block/pluginsdk/blocks"
|
"git.dev.alexdunmow.com/block/pluginsdk/blocks"
|
||||||
"git.dev.alexdunmow.com/block/pluginsdk/plugin"
|
"git.dev.alexdunmow.com/block/pluginsdk/plugin"
|
||||||
|
"git.dev.alexdunmow.com/block/pluginsdk/route"
|
||||||
"git.dev.alexdunmow.com/block/pluginsdk/templates"
|
"git.dev.alexdunmow.com/block/pluginsdk/templates"
|
||||||
"git.dev.alexdunmow.com/private/quote-requests-a1a5c0/db"
|
"git.dev.alexdunmow.com/private/quote-requests-a1a5c0/db"
|
||||||
)
|
)
|
||||||
@ -43,7 +44,7 @@ func renderForm(_ context.Context, content map[string]any) string {
|
|||||||
return `<section class="quote-request-form"><h2>` + str(content, "heading") + `</h2>` +
|
return `<section class="quote-request-form"><h2>` + str(content, "heading") + `</h2>` +
|
||||||
`<form method="post" action="/api/plugins/` + pluginName + `/submit">` +
|
`<form method="post" action="/api/plugins/` + pluginName + `/submit">` +
|
||||||
`<input name="name"><input name="email" type="email"><input name="property_address">` +
|
`<input name="name"><input name="email" type="email"><input name="property_address">` +
|
||||||
`<textarea name="roof_issue"></textarea><button type="submit">` + button + `</button></form></section>`
|
`<textarea name="roof_issue"></textarea>` + route.CaptchaWidget() + `<button type="submit">` + button + `</button></form></section>`
|
||||||
}
|
}
|
||||||
|
|
||||||
// renderRecent lists the latest requests that visitors submitted.
|
// renderRecent lists the latest requests that visitors submitted.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user