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

ParserFunctions: Fix broken navboxes on many fr.v pages

This commit is contained in:
gnosygnu 2017-06-01 23:15:35 -04:00
parent d521299987
commit e687f23586
4 changed files with 6 additions and 4 deletions

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry combineaccessrules="false" kind="src" path="/luaj-vm"/>
<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/100_core"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/140_dbs"/>

View File

@ -25,7 +25,7 @@ class Xow_page_cache_wkr__embeddable implements gplx.xowa.wikis.caches.Xow_page_
public byte[] Get_page_or_null(byte[] full_db) {
byte[] wikitext = null;
// loop to handle redirects
// loop to handle redirects; DATE:2017-05-29
int loops = 0;
while (loops++ < 5) {
wikitext = Bry_.new_u8(cbk.LoadWikitext(String_.new_u8(full_db)));
@ -34,7 +34,7 @@ class Xow_page_cache_wkr__embeddable implements gplx.xowa.wikis.caches.Xow_page_
if (redirect_ttl == null) {
break;
}
// redirect
// redirect; update title and continue;
else {
full_db = redirect_ttl.Full_db();
continue;

View File

@ -28,7 +28,7 @@ class Pfunc_tag_kvp_wtr {
if (key_bgn != -1)
tmp.Add_byte(Byte_ascii.Eq);
tmp.Add_byte(Byte_ascii.Quote);
tmp.Add(Bry_.Mid(kvp_bry, val_bgn, val_end));
tmp.Add_bry_escape_html(kvp_bry, val_bgn, val_end); // PURPOSE: escape html in atrs; PAGE:fr.v:France; DATE:2017-06-01
tmp.Add_byte(Byte_ascii.Quote);
}
}

View File

@ -26,7 +26,8 @@ public class Pfunc_tag_tst {
@Test public void Tmpl() {fxt.Test_html_full_str("{{#tag:pre|a|{{#switch:a|a=id}}=c}}" , "<pre id=\"c\">a</pre>");} // PURPOSE: args must be evaluated
@Test public void Ws_all() {fxt.Test_html_full_str("{{#tag:pre|a| id = b }}" , "<pre id=\"b\">a</pre>");}
@Test public void Ws_quoted() {fxt.Test_html_full_str("{{#tag:pre|a| id = ' b ' }}" , "<pre id=\"_b_\">a</pre>");}
@Test public void Err_bad_key() {fxt.Test_html_full_str("{{#tag:pre|a|id=val|b}}" , "<pre id=\"val\">a</pre>");} // PURPOSE: b was failing b/c id was larger and key_end set to 4 (whereas b was len=1)
@Test public void Err_bad_key() {fxt.Test_html_full_str("{{#tag:pre|a|id=val|b}}" , "<pre id=\"val\">a</pre>");} // PURPOSE: b was failing b/c id was larger and key_end set to 4 (whereas b was len=1)
@Test public void Html_is_escaped() {fxt.Test_html_full_str("{{#tag:pre|a|id='<br/>'}}" , "<pre id=\".3Cbr.2F.3E\">a</pre>");} // PURPOSE: escape html in atrs; PAGE:fr.v:France; DATE:2017-06-01
// @Test public void Missing_val() {fxt.ini_Msg(Mwl_tag_rsc.Instance.Invalid).Test_parse_tmpl_str_test("{{#tag:pre|a|id=}}" , "{{test}}" , "");} // see {{Reflist|colwidth=30em}} -> <ref group=a>a</ref>{{#tag:references||group=}} -> ""
// @Test public void Err() {
// fxt.Test_parse_tmpl_str_test("{{#tag:ref|George Robertson announced in January 2003 that he would be stepping down in December.<ref> {{cite news|title =NATO Secretary General to Leave His Post in December After 4 Years |first = Craig | last = Smith | work = The New York Times | date = January 23, 2003| url = http://www.nytimes.com/2003/01/23/world/nato-secretary-general-to-leave-his-post-in-december-after-4-years.html?scp=2&sq=lord+robertson&st=nyt|accessdate = 2009-03-29}}</ref> Jaap de Hoop Scheffer was selected as his successor, but could not assume the office until January 2004 because of his commitment in the Dutch Parliament.<ref> {{cite news|title = Jaap de Hoop Scheffer | work = Newsmakers | issue = 1 | publisher = Thomson Gale | date = January 1, 2005}}</ref> Robertson was asked to extend his term until Scheffer was ready, but declined, so Minuto-Rizzo, the Deputy Secretary General, took over in the interim.<ref name =\"ncsd\" /> |group=N|}}"