From 07dbcf1a7a3a9e3861985a01454ea30f8a6ed1b4 Mon Sep 17 00:00:00 2001 From: Muhammad Hamza Date: Sun, 28 Aug 2022 17:21:54 +0500 Subject: [PATCH] Update docs --- packages/yew/src/dom_bundle/traits.rs | 2 ++ packages/yew/src/virtual_dom/vnode.rs | 11 ++--------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/packages/yew/src/dom_bundle/traits.rs b/packages/yew/src/dom_bundle/traits.rs index 10712be2c04..6a1d5e5cf19 100644 --- a/packages/yew/src/dom_bundle/traits.rs +++ b/packages/yew/src/dom_bundle/traits.rs @@ -32,6 +32,8 @@ pub(super) trait Reconcilable { /// - `next_sibling`: to find where to put the node. /// /// Returns a reference to the newly inserted element. + /// The [`NodeRef`] points the first element (if there are multiple nodes created), + /// or is the passed in next_sibling if there are no element is created. fn attach( self, diff --git a/packages/yew/src/virtual_dom/vnode.rs b/packages/yew/src/virtual_dom/vnode.rs index 065cfe987da..dc87bce79bd 100644 --- a/packages/yew/src/virtual_dom/vnode.rs +++ b/packages/yew/src/virtual_dom/vnode.rs @@ -60,9 +60,6 @@ impl VNode { /// In the browser, this function creates an element, sets the passed HTML to its `innerHTML` /// and inserts the contents of it into the DOM. /// - /// If there are multiple elements, they're wrapped in a `div`. If this behavior is not desired, - /// ensure there is only one top level node. - /// /// # Behavior on server /// /// When rendering on the server, the contents of HTML are directly injected into the HTML @@ -70,12 +67,8 @@ impl VNode { /// /// ## Warning /// - /// The contents are **not** sanitized. You, as the developer, are responsible to - /// ensure the HTML string passed to this method not malicious - /// - /// ## Panics - /// - /// If the HTML string is invalid, the [`ServerRenderer`](crate::ServerRenderer) will panic + /// The contents are **not** sanitized or validated. You, as the developer, are responsible to + /// ensure the HTML string passed to this method are _valid_ and _not malicious_ /// /// # Example ///