fixed #31335
@@ -75,6 +75,10 @@ | ||
75 | 75 | |
76 | 76 | public String[] highlightingFields = new String[] { "hl_content", "digest" }; |
77 | 77 | |
78 | + public String highlightTagPre = "<em>"; | |
79 | + | |
80 | + public String highlightTagPost = "</em>"; | |
81 | + | |
78 | 82 | protected boolean useSession = true; |
79 | 83 | |
80 | 84 | private final Map<String, String> pageCacheMap = new ConcurrentHashMap<String, String>(); |
@@ -134,7 +138,7 @@ | ||
134 | 138 | return ""; |
135 | 139 | } |
136 | 140 | |
137 | - private String removeEmTag(final String str) { | |
141 | + protected String removeEmTag(final String str) { | |
138 | 142 | return str.replaceAll("<em>", "").replaceAll("</em>", ""); |
139 | 143 | } |
140 | 144 |
@@ -147,7 +151,8 @@ | ||
147 | 151 | for (final String query : queries) { |
148 | 152 | newContent = Pattern |
149 | 153 | .compile(Pattern.quote(query), Pattern.CASE_INSENSITIVE) |
150 | - .matcher(newContent).replaceAll("<em>" + query + "</em>"); | |
154 | + .matcher(newContent) | |
155 | + .replaceAll(highlightTagPre + query + highlightTagPost); | |
151 | 156 | } |
152 | 157 | return newContent; |
153 | 158 | } |