Skip to content

Commit 78540e2

Browse files
committed
Tabs: Allow non-latin characters for ids. Fixes #4581 - title attribute for remote tabs does not support foreign languages.
1 parent ddb9a78 commit 78540e2

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

tests/unit/tabs/tabs.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ <h2 id="qunit-userAgent"></h2>
6161
<li><a href="#colon:test"><span>1</span></a></li>
6262
<li><a href="#inline-style"><span>2</span></a></li>
6363
<li><a href="data/test.html#test"><span>3</span></a></li>
64+
<li><a href="data/test.html" title="∫ßáö Սե"<span>4</span></a></li>
6465
</ul>
6566
<div id="colon:test"></div>
6667
<div style="height: 300px;" id="inline-style"></div>

tests/unit/tabs/tabs_tickets.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ test('#5069 - ui.tabs.add creates two tab panels when using a full URL', functio
7070

7171
});
7272

73-
7473
test('#5893 - Sublist in the tab list are considered as tab', function() {
7574
// http://dev.jqueryui.com/ticket/5893
7675
expect(1);
@@ -80,5 +79,16 @@ test('#5893 - Sublist in the tab list are considered as tab', function() {
8079

8180
});
8281

82+
asyncTest( "#4581 - title attribute for remote tabs does not support foreign languages", function() {
83+
expect( 1 );
84+
85+
$( "#tabs2" ).tabs({
86+
selected: 3,
87+
load: function( event, ui ) {
88+
equal( ui.panel.id, "∫ßáö_Սե", "proper title" );
89+
start();
90+
}
91+
});
92+
});
8393

8494
})(jQuery);

ui/jquery.ui.tabs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ $.widget( "ui.tabs", {
6363
},
6464

6565
_tabId: function( a ) {
66-
return a.title && a.title.replace( /\s/g, "_" ).replace( /[^A-Za-z0-9\-_:\.]/g, "" ) ||
66+
return a.title && a.title.replace( /\s/g, "_" ).replace( /[^\w\u00c0-\uFFFF-]/g, "" ) ||
6767
this.options.idPrefix + getNextTabId();
6868
},
6969

0 commit comments

Comments
 (0)