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

TemplateStyles: Scope TemplateStyles css to main content div by adding 'mw-parser-output' [#426]

This commit is contained in:
gnosygnu 2020-04-10 07:07:28 -04:00
parent 7ad1291768
commit 5a35f3b05b
2 changed files with 4 additions and 4 deletions

View File

@ -105,7 +105,7 @@ public class Template_styles_nde implements Xox_xnde, Mwh_atr_itm_owner2 {
public static final byte Xatr__src = 0; public static final byte Xatr__src = 0;
private static final Hash_adp_bry xatrs_hash = Hash_adp_bry.ci_a7().Add_str_byte("src", Xatr__src); private static final Hash_adp_bry xatrs_hash = Hash_adp_bry.ci_a7().Add_str_byte("src", Xatr__src);
private static final Bry_fmt private static final Bry_fmt
html_head = Bry_fmt.Auto("\n/*TemplateStyles:r~{id}*/\n~{css}") html_head = Bry_fmt.Auto("\n/*TemplateStyles:r~{id}*/\n.mw-parser-output ~{css}") // .mw-parser-output needs to be added to all TemplateStyles CSS, else TS ids called "portal" will affect sidebar; ISSUE#:426; PAGE:en.w:Poland DATE:2020-04-10
, html_error = Bry_fmt.Auto("<strong class=\"error\">~{msg}</strong>") , html_error = Bry_fmt.Auto("<strong class=\"error\">~{msg}</strong>")
; ;
} }

View File

@ -59,7 +59,7 @@ public class Template_styles_nde_tst {
) )
, "" , ""
, fxt.Make__style(0, css_red) , fxt.Make__style(0, css_red)
+ fxt.Make__style(1, css_blue) + fxt.Make__style(1, css_blue)
); );
} }
@Test public void Dedupe() { // PURPOSE: multiple calls to same page should output link; DATE:2018-12-30 @Test public void Dedupe() { // PURPOSE: multiple calls to same page should output link; DATE:2018-12-30
@ -72,7 +72,7 @@ public class Template_styles_nde_tst {
) )
, "" , ""
, String_.Concat_lines_nl , String_.Concat_lines_nl
( fxt.Make__style(0, css)) ( fxt.Make__style(0, css))
); );
} }
@Test public void Tag() { // PURPOSE: {{#tag}} @Test public void Tag() { // PURPOSE: {{#tag}}
@ -131,7 +131,7 @@ class Template_styles_nde_fxt {
return ".style0{color:" + color + ";}"; return ".style0{color:" + color + ";}";
} }
public String Make__style(int id, String css) { public String Make__style(int id, String css) {
return "\n/*TemplateStyles:r" + id + "*/\n" + css; return "\n/*TemplateStyles:r" + id + "*/\n.mw-parser-output " + css; // .mw-parser-output needs to be added to all TemplateStyles CSS, else TS ids called "portal" will affect sidebar; ISSUE#:426; PAGE:en.w:Poland DATE:2020-04-10
} }
public void Test__parse(String src, String expd_html, String expd_head) { public void Test__parse(String src, String expd_html, String expd_head) {
parser_fxt.Test__parse__tmpl_to_html(src, expd_html); parser_fxt.Test__parse__tmpl_to_html(src, expd_html);