trailing hash characters should get trimmed
add tests