--- a/static/text-annotation.js +++ b/static/text-annotation.js @@ -51,7 +51,12 @@ backdrop: false, }); $('.well a').click(function(event){ - xpath = $(event.currentTarget).text().split('#')[1]; + if($(event.currentTarget).text().search('#')){ + len = $(event.currentTarget).text().split('#').len(); + xpath = $(event.currentTarget).text().split('#')[len-1]; + } + else + xpath = $(event.currentTarget).text(); var nodes = document.evaluate(xpath, document, null, XPathResult.ANY_TYPE,null); result = nodes.iterateNext(); while(result){