Loading lib/jsduck/guide_anchors.rb +1 −1 Original line number Diff line number Diff line Loading @@ -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| Loading spec/guide_anchors_spec.rb +6 −1 Original line number Diff line number Diff line Loading @@ -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>" Loading template/app/controller/Classes.js +1 −1 Original line number Diff line number Diff line Loading @@ -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 }); Loading template/app/controller/Examples.js +1 −1 Original line number Diff line number Diff line Loading @@ -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); Loading template/app/controller/Guides.js +1 −1 Original line number Diff line number Diff line Loading @@ -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 Loading
lib/jsduck/guide_anchors.rb +1 −1 Original line number Diff line number Diff line Loading @@ -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| Loading
spec/guide_anchors_spec.rb +6 −1 Original line number Diff line number Diff line Loading @@ -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>" Loading
template/app/controller/Classes.js +1 −1 Original line number Diff line number Diff line Loading @@ -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 }); Loading
template/app/controller/Examples.js +1 −1 Original line number Diff line number Diff line Loading @@ -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); Loading
template/app/controller/Guides.js +1 −1 Original line number Diff line number Diff line Loading @@ -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