Skip to content

Commit

Permalink
Fix POSH sniffer
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergey Malinin committed Oct 25, 2016
1 parent 5f98061 commit 4e2c354
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/lib/posh.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ var POSH = (function () {
var href = el.getAttribute("href");

if (rel && href) {
href = fix_href(href);
href = encodeURI(fix_href(href));
var title = el.getAttribute("title");
var type = el.getAttribute("type");
addTriple("#this", encodeURI(rel), href);
Expand All @@ -306,7 +306,7 @@ var POSH = (function () {
addTriple(href+"#this", "schema:fileFormat", type);
}
else if(rev && href) {
href = fix_href(href);
href = encodeURI(fix_href(href));
addTriple(href, encodeURI(rev), "<#this>")
}
}
Expand Down
13 changes: 8 additions & 5 deletions src/panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -556,12 +556,15 @@ function check_POSH(dData)
var handler = new Handle_Turtle();
handler.parse([dData.posh.text], dData.docURL,
function(error, html_data) {
gData.posh.ttl_text = dData.posh.text;
if (error)
dData.posh.error = error;
else {
dData.posh.error.push(error);

if (html_data)
dData.posh.expanded = html_data;
gData.posh.ttl_text = dData.posh.text;
}

if (handler.skipped_error.length>0)
dData.posh.error = dData.posh.error.concat(handler.skipped_error);

check_RDFa(dData);
});
Expand Down Expand Up @@ -615,7 +618,7 @@ function parse_Data(dData)
dData.j_nano.expanded = null;
dData.j_nano.error = null;
dData.posh.expanded = null;
dData.posh.error = null;
dData.posh.error = [];
doc_URL = dData.docURL;

load_restData(doc_URL);
Expand Down

0 comments on commit 4e2c354

Please sign in to comment.