Fixed issue where missing identifiers pushed trivia into the navigation bar

Fixes #1183.
As of our discussion, should we use ```substr```?