diff --git a/js/dictionaryBuilder.js b/js/dictionaryBuilder.js
index 8fdf086..f429629 100644
--- a/js/dictionaryBuilder.js
+++ b/js/dictionaryBuilder.js
@@ -273,8 +273,10 @@ function DictionaryEntry(itemIndex) {
var wordName = wordPronunciation = wordPartOfSpeech = wordSimpleDefinition = wordLongDefinition = "";
if (searchTerm != "" && searchByWord) {
+ // Parse HTML Entities while searching so the regex can search actual characters instead of HTML.
wordName += htmlEntitiesParse(currentDictionary.words[itemIndex].name).replace(searchRegEx, "
","").replace("
",""); } - if (currentDictionary.words[itemIndex].partOfSpeech != "") { + if (currentDictionary.words[itemIndex].partOfSpeech != " " && currentDictionary.words[itemIndex].partOfSpeech != "") { wordPartOfSpeech += currentDictionary.words[itemIndex].partOfSpeech.toString(); } @@ -706,17 +708,17 @@ function ExportWords() { var wordsCSV = "word,pronunciation,part of speech,equivalent,explanation\n"; for (var i = 0; i < currentDictionary.words.length; i++) { - var word = htmlEntities(currentDictionary.words[i].name).trim(); - var pronunciation = htmlEntities(currentDictionary.words[i].pronunciation).trim(); - var partOfSpeech = htmlEntities(currentDictionary.words[i].partOfSpeech).trim(); - var simpleDefinition = htmlEntities(currentDictionary.words[i].simpleDefinition).trim(); - var longDefinition = htmlEntities(currentDictionary.words[i].longDefinition); + var word = "\"" + htmlEntitiesParse(currentDictionary.words[i].name).trim().replace(/\"/g, "\"\"") + "\""; + var pronunciation = "\"" + htmlEntitiesParse(currentDictionary.words[i].pronunciation).trim().replace(/\"/g, "\"\"") + "\""; + var partOfSpeech = "\"" + htmlEntitiesParse(currentDictionary.words[i].partOfSpeech).trim().replace(/\"/g, "\"\"") + "\""; + var simpleDefinition = "\"" + htmlEntitiesParse(currentDictionary.words[i].simpleDefinition).trim().replace(/\"/g, "\"\"") + "\""; + var longDefinition = "\"" + htmlEntitiesParse(currentDictionary.words[i].longDefinition).replace(/\"/g, "\"\"") + "\""; wordsCSV += word + "," + pronunciation + "," + partOfSpeech + "," + simpleDefinition + "," + longDefinition + "\n"; } download(downloadName + ".csv", wordsCSV); } else { - alert("Dictionary must have at least 1 word to export.") + alert("Dictionary must have at least 1 word to export."); } } @@ -785,7 +787,7 @@ function ImportWords() { var file = document.getElementById("importWordsCSV").files[0]; var resultsArea = document.getElementById("importOptions"); - resultsArea.innerHTML = ""; + resultsArea.innerHTML = "