Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change to prefer data-lt for referring to link-titles #468

Merged
merged 3 commits into from Jul 31, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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