Commit 9f6f74a9 authored by Rene Saarsoo's avatar Rene Saarsoo
Browse files

Merge branch 'master' into doc-tags

parents dfa87c30 c816fec6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ module JsDuck
  class GuideAnchors

    def self.transform(html, guide_name)
      html.gsub(/(<a\s+(?:[^<>]*\s+)?href=['"]#)([^!].*?)(['"])/i) do |m|
      html.gsub(/(<a\s+(?:[^<>]*\s+)?href=['"]#)([^!\/].*?)(['"])/i) do |m|
        "#{$1}!/guide/#{guide_name}-section-#{$2}#{$3}"

      end.gsub(/(<a\s+(?:[^<>]*\s+)?name=['"])(.*?)(['"])/i) do |m|
+6 −1
Original line number Diff line number Diff line
@@ -31,6 +31,11 @@ describe JsDuck::GuideAnchors do
      "<a href='#!/api/Ext.Base'>Ext.Base</a>"
  end

  it "doesn't transform docs-app (backwards-compatible) # links" do
    transform("<a href='#/api/Ext.Base'>Ext.Base</a>").should ==
      "<a href='#/api/Ext.Base'>Ext.Base</a>"
  end

  it "transforms anchors" do
    transform("<a name='blah'>target</a>").should ==
      "<a name='myguide-section-blah'>target</a>"
+1 −1
Original line number Diff line number Diff line
@@ -228,7 +228,7 @@ Ext.define('Docs.controller.Classes', {
                failure: function(response, opts) {
                    this.cache[cls] = false;
                    this.getOverview().setLoading(false);
                    this.getController('Failure').show404("Class <b>"+cls+"</b> was not found.");
                    this.getController('Failure').show404("Class <b>"+Ext.String.htmlEncode(cls)+"</b> was not found.");
                },
                scope: this
            });
+1 −1
Original line number Diff line number Diff line
@@ -90,7 +90,7 @@ Ext.define('Docs.controller.Examples', {
    loadExample: function(url, noHistory) {
        var example = this.getExample(url);
        if (!example) {
            this.getController('Failure').show404("Example <b>"+url+"</b> was not found.");
            this.getController('Failure').show404("Example <b>"+Ext.String.htmlEncode(url)+"</b> was not found.");
            return;
        }
        this.getViewport().setPageTitle(example.text);
+1 −1
Original line number Diff line number Diff line
@@ -119,7 +119,7 @@ Ext.define('Docs.controller.Guides', {
                },
                failure: function(response, opts) {
                    this.cache[name] = false;
                    this.getController('Failure').show404("Guide <b>"+name+"</b> was not found.");
                    this.getController('Failure').show404("Guide <b>"+Ext.String.htmlEncode(name)+"</b> was not found.");
                },
                scope: this
            });
Loading