You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<strong><!-- comment 1 . --><h1class="jump">Title with <strong>BOLD</strong></h1><script>console.log('sgasdg');</script><script>console.log('2222');</script><!-- commebsdg 2. --><h3style="text-color:red, width:50px" class="big top" data-goodcustom="ddd" onclick="alert('dasdg')">Subject</h3>
<![CDATA[
Within this Character Data block I can
use double dashes as much as I want (along with <, &, ', and ")
*and* %MyParamEntity; will be expanded to the text
"Has been expanded" ... however, I can't use
the CEND sequence. If I need to use CEND I must escape one of the
brackets or the greater-than sign using concatenated CDATA sections.
]]></strong>
using html.Parse.
It adds <html><head> </head><body> ... </body></head></html> tags at the start and the end.
There should be an option to disable adding these tags that don't exist in source html.
func ParseFragment(r io.Reader, context *Node) ([]*Node, error) requires a context which I can't provide.
The text was updated successfully, but these errors were encountered:
pjebs
changed the title
proposal: x/net/html: Option to not add <html><head> </head><body> ... </body></head></html> tags
proposal: x/net/html: Option to not add <html><head></head><body> ... </body></head></html> tags
Jan 18, 2025
A context is necessary to maintain the proper security properties of x/net/html as processing of html can be dependent on the context it is in.
You can construct an appropriate fake context if necessary.
Proposal Details
If I try and parse:
using
html.Parse
.It adds
<html><head> </head><body> ... </body></head></html>
tags at the start and the end.There should be an option to disable adding these tags that don't exist in source html.
func ParseFragment(r io.Reader, context *Node) ([]*Node, error)
requires acontext
which I can't provide.The text was updated successfully, but these errors were encountered: