File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ module JsDuck
88 class GuideAnchors
99
1010 def self . transform ( html , guide_name )
11- html . gsub ( /(<a\s +(?:[^<>]*\s +)?href=['"]#)([^!].*?)(['"])/i ) do |m |
11+ html . gsub ( /(<a\s +(?:[^<>]*\s +)?href=['"]#)([^!\/ ].*?)(['"])/i ) do |m |
1212 "#{ $1} !/guide/#{ guide_name } -section-#{ $2} #{ $3} "
1313
1414 end . gsub ( /(<a\s +(?:[^<>]*\s +)?name=['"])(.*?)(['"])/i ) do |m |
Original file line number Diff line number Diff line change @@ -26,11 +26,16 @@ def transform(html)
2626 "<a href='http://example.com'>label</a>"
2727 end
2828
29- it "doesn't transform docs-app #! links " do
29+ it "doesn't transform docs-app #! links" do
3030 transform ( "<a href='#!/api/Ext.Base'>Ext.Base</a>" ) . should ==
3131 "<a href='#!/api/Ext.Base'>Ext.Base</a>"
3232 end
3333
34+ it "doesn't transform docs-app (backwards-compatible) # links" do
35+ transform ( "<a href='#/api/Ext.Base'>Ext.Base</a>" ) . should ==
36+ "<a href='#/api/Ext.Base'>Ext.Base</a>"
37+ end
38+
3439 it "transforms anchors" do
3540 transform ( "<a name='blah'>target</a>" ) . should ==
3641 "<a name='myguide-section-blah'>target</a>"
You can’t perform that action at this time.
0 commit comments