make append_content and prepend_content work with all node types