Skip to content

Commit

Permalink
fixed tiny bug in case of empty string that evalulated to false and w…
Browse files Browse the repository at this point in the history
…as triggering an error message.
  • Loading branch information
Maurizio Monge committed Dec 20, 2015
1 parent 147cbe2 commit 51e3c48
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -3,7 +3,7 @@

This project provides a script that searches all kanji's in a web page, adding a clickable link on
all kanjis appearing on a web page. You can display the result on
[this page](http://im.ufrj.br/~maurizio.monge/kanjax/test.html)
[this page](http://im.ufrj.br/~maurizio.monge/kanjax/test.html).

This library was inspired by MathJax, that automatically formats mathematical formulas in web pages.

Expand Down
5 changes: 4 additions & 1 deletion kanjax/kanjax.js
Expand Up @@ -44,7 +44,10 @@ KanJax = {
content = KanJax.popupContent.replace(
/\{\{(\w+)\}\}/g,
function(match, key) {
return info[key] || ("{unknown field "+key+"}");
if(key in info)
return info[key]
else
return "{unknown field "+key+"}";
});
div.innerHTML = content;

Expand Down

0 comments on commit 51e3c48

Please sign in to comment.