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:
parent
f138db17ca
commit
3a3bc01e82
@ -50,7 +50,7 @@ public class Xop_uniq_mgr { // REF.MW:/parser/StripState.php
|
|||||||
|
|
||||||
// add to bfr
|
// add to bfr
|
||||||
if (dirty_bfr == null) dirty_bfr = key_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));
|
dirty_bfr.Add((byte[])general_trie.Match_exact(src, uniq_bgn, uniq_end));
|
||||||
cur = uniq_end;
|
cur = uniq_end;
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,13 @@ public class Xop_uniq_mgr__tst {
|
|||||||
fxt.Test__add("2", key);
|
fxt.Test__add("2", key);
|
||||||
fxt.Test__convert("1" + key + "3", "123");
|
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 {
|
class Xop_uniq_mgr__fxt {
|
||||||
private final Xop_uniq_mgr mgr = new Xop_uniq_mgr();
|
private final Xop_uniq_mgr mgr = new Xop_uniq_mgr();
|
||||||
|
Loading…
Reference in New Issue
Block a user