Commit a89c06a3 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Make a member expandable if it contains @deprecated.

Takes care of the silly case where member contains no other
documentation than a @deprecated tag.
parent 4b61d53e
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ module JsDuck
      @formatter.doc_context = m
      m[:doc] = @formatter.format(m[:doc]) if m[:doc]
      m[:deprecated][:text] = @formatter.format(m[:deprecated][:text]) if m[:deprecated]
      if m[:params] || (m[:properties] && m[:properties].length > 0) || m[:default] || @formatter.too_long?(m[:doc])
      if expandable?(m) || @formatter.too_long?(m[:doc])
        m[:shortDoc] = @formatter.shorten(m[:doc])
      end
      m[:html_type] = format_type(m[:type]) if m[:type] && @include_types
@@ -46,6 +46,10 @@ module JsDuck
      m
    end

    def expandable?(m)
      m[:params] || (m[:properties] && m[:properties].length > 0) || m[:default] || m[:deprecated]
    end

    def format_item(it)
      it[:doc] = @formatter.format(it[:doc]) if it[:doc]
      it[:html_type] = format_type(it[:type]) if it[:type] && @include_types