1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2024-10-27 20:34:16 +00:00

Parser.Uniq: Fix possible bug with readding entire page instead of only sections

This commit is contained in:
gnosygnu 2017-01-25 10:00:04 -05:00
parent f138db17ca
commit 3a3bc01e82
2 changed files with 8 additions and 1 deletions

View File

@ -50,7 +50,7 @@ public class Xop_uniq_mgr { // REF.MW:/parser/StripState.php
// add to bfr
if (dirty_bfr == null) dirty_bfr = key_bfr;
dirty_bfr.Add_mid(src, 0, uniq_bgn);
dirty_bfr.Add_mid(src, cur, uniq_bgn);
dirty_bfr.Add((byte[])general_trie.Match_exact(src, uniq_bgn, uniq_end));
cur = uniq_end;
}

View File

@ -51,6 +51,13 @@ public class Xop_uniq_mgr__tst {
fxt.Test__add("2", key);
fxt.Test__convert("1" + key + "3", "123");
}
@Test public void Convert__many() {
String key_0 = "UNIQ-item-0--QINU";
String key_1 = "UNIQ-item-1--QINU";
fxt.Test__add("0", key_0);
fxt.Test__add("1", key_1);
fxt.Test__convert("a " + key_0 + " b " + key_1 + " c", "a 0 b 1 c");
}
}
class Xop_uniq_mgr__fxt {
private final Xop_uniq_mgr mgr = new Xop_uniq_mgr();