1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

Mw_parse: Handle interrupt and separator logic for magiclinks

This commit is contained in:
gnosygnu
2017-01-28 02:47:22 -05:00
parent e231df0ce1
commit 7e27b5415d
6 changed files with 263 additions and 70 deletions

View File

@@ -39,7 +39,7 @@ public class Php_str_ {
int end = len < 0 ? src_len + len : bgn + len;
if (end > src.length) end = src.length;; // handle out of bounds;
return src[bgn];
}
}
public static int Strspn_fwd__ary(byte[] src, boolean[] find, int bgn, int max, int src_len) {
if (max == -1) max = src_len;
int rv = 0;
@@ -90,6 +90,17 @@ public class Php_str_ {
}
return rv;
}
public static int Strspn_bwd__ary(byte[] src, boolean[] find, int bgn, int max) {
if (max == -1) max = Int_.Max_value;
int rv = 0;
for (int i = bgn - 1; i > -1; i--) {
if (find[src[i]] && rv < max)
rv++;
else
break;
}
return rv;
}
public static int Strspn_bwd__space_or_tab(byte[] src, int bgn, int max) {
if (max == -1) max = Int_.Max_value;
int rv = 0;