Skip to content

Instantly share code, notes, and snippets.

@daemontus
Created March 27, 2013 09:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save daemontus/5252856 to your computer and use it in GitHub Desktop.
Save daemontus/5252856 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="cs">
<head>
<title>Document modification example</title>
</head>
<body>
<p>
<strong class="red blue" data-test="abc" disabled>
<i>Some text</i>
</strong>
</p>
<p></p>
<p>
<strong class="red blue" data-test="abc" disabled>
<i>Some text</i>
</strong>
</p>
</body>
</html>
<!DOCTYPE html>
<html lang="cs">
<head>
<title>Document modification example</title>
</head>
<body>
<p>
<strong class="red blue" data-test="abc" disabled >
<i>Some text</i>
</strong>
</p>
</body>
</html>
#include "html.h"
int main(void)
{
element* html = readDocument();
element *clone = cloneNode(html->lastChild->firstChild, true);
appendChild(html->lastChild, clone);
element *clone2 = cloneNode(html->lastChild->firstChild, true);
appendChild(html->lastChild, clone2);
deleteElement(clone->lastChild);
printDocument(html);
deleteElement(html);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment