RemoveAttribute removes the attribute with the given name from the body. The return value is the attribute that was removed, or nil if there was no such attribute (in which case the call was a no-op).
(name string)
| 219 | // The return value is the attribute that was removed, or nil if there was |
| 220 | // no such attribute (in which case the call was a no-op). |
| 221 | func (b *Body) RemoveAttribute(name string) *Attribute { |
| 222 | node := b.getAttributeNode(name) |
| 223 | if node == nil { |
| 224 | return nil |
| 225 | } |
| 226 | node.Detach() |
| 227 | b.items.Remove(node) |
| 228 | return node.content.(*Attribute) |
| 229 | } |
| 230 | |
| 231 | // AppendBlock appends an existing block (which must not be already attached |
| 232 | // to a body) to the end of the receiving body. |