]> gitweb.fperrin.net Git - DictionaryPC.git/blobdiff - src/com/hughes/android/dictionary/parser/wiktionary/WholeSectionToHtmlParser.java
Small updates to dictionary generation.
[DictionaryPC.git] / src / com / hughes / android / dictionary / parser / wiktionary / WholeSectionToHtmlParser.java
index c5dca8098fb782519905fc8a8af79ae13e9a3f13..046d9984cc3804a3042a8de3aa24031b0d7f9b77 100644 (file)
@@ -261,7 +261,11 @@ public class WholeSectionToHtmlParser extends AbstractWiktionaryParser {
 
         if (webUrlTemplate != null) {
             final String webUrl = String.format(webUrlTemplate, title);
+           // URI.create can raise an exception e.g. if webUrl contains %, just ignore those cases.
+           try {
             callback.builder.append(String.format("<p> <a href=\"%s\">%s</a>", URI.create(webUrl).toString(), escapeHtmlLiteral(webUrl)));
+           } catch (Exception e)
+           {}
         }
         htmlEntry.html = callback.builder.toString();
         indexedEntry.isValid = true;