Skip to content

Commit

Permalink
Don't use a selector to get the heading text for search results.
Browse files Browse the repository at this point in the history
Prevents bugs with special CSS characters.

Closes #201.
  • Loading branch information
realityking authored and lord committed Apr 30, 2015
1 parent 23eb3f4 commit 5da237e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/javascripts/app/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@
if (results.length) {
searchResults.empty();
$.each(results, function (index, result) {
searchResults.append("<li><a href='#" + result.ref + "'>" + $('#'+result.ref).text() + "</a></li>");
var elem = document.getElementById(result.ref);
searchResults.append("<li><a href='#" + result.ref + "'>" + $(elem).text() + "</a></li>");
});
highlight.call(this);
} else {
Expand Down

0 comments on commit 5da237e

Please sign in to comment.