Commit 5c1c5aa5 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Fix ignoring of @tags in e-mail addresses in Ruby 1.8.

In Ruby 1.9 string[x] returns a string but in Ruby 1.8 it returns
a char code.  Fixed by using sting[x,y] which always returns a string.
parent 0f94aa5c
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -165,11 +165,15 @@ module JsDuck
    def skip_to_next_at_tag
      @current_tag[:doc] += match(/[^@]+/)

      while @current_tag[:doc][-1] =~ /\S/ && look(/@/)
      while !prev_char_is_whitespace? && look(/@/)
        @current_tag[:doc] += match(/@+[^@]+/)
      end
    end

    def prev_char_is_whitespace?
      @current_tag[:doc][-1,1] =~ /\s/
    end

    # Processes anything else beginning with @-sign.
    #
    # - When @ is not followed by any word chards, do nothing.