From fcd557342223305d3012c99d184692be94469ac1 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Wed, 17 Jun 2015 21:48:40 +0200 Subject: [PATCH] Updated changelog for Node#replace --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71bf2f0..a093e13 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,28 @@ This document contains details of the various releases and their release dates. Dates are in the format `yyyy-mm-dd`. +## 1.1.0 - Unreleased + +### Support for replacing of DOM nodes + +The newly added method `Oga::XML::Node#replace` can be used to replace an +existing node with another node or with a String (which will result in it being +replaced with a Text node). For example: + + p = Oga::XML::Element.new(:name => 'p') + div = Oga::XML::Element.new(:name => 'div', :children => [p]) + + puts div.to_xml # => "

" + + p.replace('Hello world!') + + puts div.to_xml # => "
Hello world!
" + +Thanks to Tero Tasanen for adding this. + +See commit 0b4791b277abf492ae0feb1c467dfc03aef4f2ec and + for more information. + ## 1.0.3 - 2015-06-16 ### Strict XML parsing support