Handle missing rel attribute on matching <link> in DC prefix search
This commit is contained in:
parent
3f9e9d0cf4
commit
47be01a6ae
1 changed files with 5 additions and 3 deletions
|
@ -23,9 +23,11 @@ function getDCPrefix(doc) {
|
|||
for(var i=0; i<links.length; i++) {
|
||||
if(links[i].getAttribute("href") == _dc) {
|
||||
var rel = links[i].getAttribute("rel");
|
||||
var matches = rel.match(/^schema\.([a-zA-Z]+)/);
|
||||
if(matches) {
|
||||
_prefix = matches[1].toLowerCase() + ".";
|
||||
if(rel) {
|
||||
var matches = rel.match(/^schema\.([a-zA-Z]+)/);
|
||||
if(matches) {
|
||||
_prefix = matches[1].toLowerCase() + ".";
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue