diff --git a/README.md b/README.md index 5f7dbf5..6450138 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/kanjax/kanjax.js b/kanjax/kanjax.js index 1b5c19f..1bc9a74 100644 --- a/kanjax/kanjax.js +++ b/kanjax/kanjax.js @@ -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;