Skip to content

Commit

Permalink
Merge pull request #468 from w3c/p466
Browse files Browse the repository at this point in the history
Change to prefer data-lt for referring to link-titles
  • Loading branch information
halindrome committed Jul 31, 2015
2 parents 09a66fd + cdebcc6 commit 115b81b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions js/core/utils.js
Expand Up @@ -45,17 +45,18 @@ define(
var titles = [];
var theAttr = "";
var titleString = "";
if (( !args || (args && args.isDefinition != true) ) && this.attr("data-lt")) {
// only look for a data-lt when we are NOT being called to create a
// new definition
if (this.attr("data-lt")) {
// prefer @data-lt for the list of title aliases
titleString = this.attr("data-lt");
theAttr = "data-lt";
}
else if (this.attr("lt")) {
// allow @lt to be consistent with bikeshed
titleString = this.attr("lt");
theAttr = "lt";
}
else if (this.attr("title")) {
// allow @title for backward compatibility
titleString = this.attr("title");
theAttr = "title";
respecEvents.pub("warn", "Using deprecated attribute @title for '" + this.text() + "': see http://w3.org/respec/guide.html#definitions-and-linking");
Expand Down
4 changes: 2 additions & 2 deletions tests/spec/core/utils-spec.js
Expand Up @@ -98,12 +98,12 @@ describe("Core - Utils", function () {
expect(utils.isoDate("2013-06-25")).toMatch(/2013-06-2[45]T/) ;
var d = new Date();
d.setFullYear(2013);
d.setMonth(5);
d.setDate(25);
d.setMonth(8);
d.setHours(0);
d.setMinutes(0);
d.setSeconds(0);
expect(utils.isoDate(d)).toMatch(/2013-06-2[45]T/);
expect(utils.isoDate(d)).toMatch(/2013-09-2[45]T/);
});
});

Expand Down

0 comments on commit 115b81b

Please sign in to comment.