mirror of
https://github.com/gnosygnu/xowa.git
synced 2024-10-27 20:34:16 +00:00
Full-text search: Escape angle bracket in results
This commit is contained in:
parent
0e3ebac674
commit
269a3c3f65
@ -74,13 +74,21 @@ public class Xosearch_finder_cbk__highlight implements Xosearch_finder_cbk {
|
|||||||
.Add_int("found", found)
|
.Add_int("found", found)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
private static final byte[] Angle_bgn_escaped = Bry_.new_a7("<");
|
||||||
private void Add_snip(Bry_bfr bfr, byte[] src, int bgn, int end) {
|
private void Add_snip(Bry_bfr bfr, byte[] src, int bgn, int end) {
|
||||||
for (int i = bgn; i < end; i++) {
|
for (int i = bgn; i < end; i++) {
|
||||||
byte b = src[i];
|
byte b = src[i];
|
||||||
if (b == Byte_ascii.Nl)
|
switch (b) {
|
||||||
|
case Byte_ascii.Angle_bgn:
|
||||||
|
bfr.Add(Angle_bgn_escaped);
|
||||||
|
break;
|
||||||
|
case Byte_ascii.Nl:
|
||||||
bfr.Add(gplx.langs.htmls.Gfh_tag_.Br_inl);
|
bfr.Add(gplx.langs.htmls.Gfh_tag_.Br_inl);
|
||||||
else
|
break;
|
||||||
|
default:
|
||||||
bfr.Add_byte(b);
|
bfr.Add_byte(b);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void Process_page_done(byte[] src, Xosearch_word_node tree_root) {}
|
public void Process_page_done(byte[] src, Xosearch_word_node tree_root) {}
|
||||||
|
Loading…
Reference in New Issue
Block a user