-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inject HTML into a node #1
Comments
Does the node erase everything it has, like its current tag name, and all its children nodes? I'd need more detailed description and examples. |
Replaces the inner() contents and returns the Slice of injected nodes. So, the return would have two Nodes in it... one TextNode ("Hey ") and one Element ("hr"). And its current tag name is untouched. The element itself is untouched. |
Then, in your opening comment, should "node.String()" be really "node.Content". I thought String() would output the node itself and its children, wouldn't it? So this is the same as SetContent, except we are dealing with HTML here? |
Yes, exactly. And you are totally correct. My mistake. On Nov 16, 2011, at 10:43 AM, Zhigang Chen wrote:
|
Add SetHtmlContent for Element. A testcase is also added. |
Implementing it this way makes it impossible to get the See my example above where it injects the new nodes into On Nov 16, 2011, at 11:18 AM, Zhigang Chen wrote:
|
Then "Replaces the inner() contents" is at odds with the example. |
Blah. What is wrong with me? This should inject some new nodes (inputted as an HTML string) to the bottom of
|
You can use AppendHtmlContent check the commit:
|
There should be a way to inject HTML into a node. For instance,
And, furthermore, this new div has to be properly doc'd.
The text was updated successfully, but these errors were encountered: