lang: use characters before `#` or ' ' as id and discard the rest.
closes #881