Don't consider `$` as part of Scala identifiers.

'$' are implementation specific, but can appear in legitimate programs as escape
sequences in interpolated strings. Hyperlinking should only consider the identifier
without '$' signs. 

Fixed #1001408

(should be backported)