add doc for elements-as-arguments
check trailing_newline to avoid when element is empty
update tests
update tests
update tests