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

Fix formatting links in @deprecated tags.

A regression cause by implementing @deprecated as meta-tag but
forgetting to set the formatter context before calling #to_html.
parent f8c0e23b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ module JsDuck
      @renderer = Renderer.new
      # Inject formatter to all meta-tags.
      doc_formatter = DocFormatter.new(relations, opts)
      MetaTagRegistry.instance.tags.each {|tag| tag.formatter = doc_formatter }
      MetaTagRegistry.instance.formatter = doc_formatter
    end

    # Returns compacted class data hash which contains an additional
+11 −0
Original line number Diff line number Diff line
@@ -27,6 +27,17 @@ module JsDuck
      @map[name]
    end

    # Returns the formatter assigned to tags
    def formatter
      @formatter
    end

    # Sets the doc-formatter for all tags
    def formatter=(doc_formatter)
      @formatter = doc_formatter
      @tags.each {|tag| tag.formatter = doc_formatter }
    end

    # Returns array of attributes to be shown in member signatures
    # (and in order they should be shown in).
    def signatures
+5 −0
Original line number Diff line number Diff line
@@ -9,6 +9,10 @@ module JsDuck
    def render(cls)
        @cls = cls

        # Set doc-formatter context to this class
        MetaTagRegistry.instance.formatter.class_context = @cls[:name]
        MetaTagRegistry.instance.formatter.doc_context = @cls[:files][0]

        return [
          "<div>",
            render_sidebar,
@@ -245,6 +249,7 @@ module JsDuck
        doc << "<p>Defaults to: <code>" + CGI.escapeHTML(m[:default]) + "</code></p>"
      end

      MetaTagRegistry.instance.formatter.doc_context = m[:files][0]
      doc << render_meta_data(m[:meta])

      doc << render_params_and_return(m)