#18 Duplicate html tags being generated by stacking SMF + MediaWiki headers

Open
opened 2 years ago by malacoda · 1 comments
malacoda commented 2 years ago

Currently the wiki skin is generating double , and tags, because it's stacking the SMF header on top of mediawiki's one.

Ideally it would use SMF's header, but intelligently inject mediawiki's required includes and title tag into it. The tag should also be mediawiki's, because it includes classes which could be helpful for fine-tuned styling.

Possible solution: when executing SMF's header template, strip out tags we don't want such as the <title>, and then when generating mediawiki's header do so likewise for tags we don't want coming from it.

Currently the wiki skin is generating double <html>, <head> and <body> tags, because it's stacking the SMF header on top of mediawiki's one. Ideally it would use SMF's header, but intelligently inject mediawiki's required includes and title tag into it. The <body> tag should also be mediawiki's, because it includes classes which could be helpful for fine-tuned styling. Possible solution: when executing SMF's header template, strip out tags we don't want such as the `<title>`, and then when generating mediawiki's header do so likewise for tags we don't want coming from it.
malacoda commented 2 years ago
Owner
<!DOCTYPE html>
<html lang="en" dir="ltr" class="client-nojs">
<head>
<meta charset="UTF-8"/>
<title>Glitch City Laboratories</title>
<script>document.documentElement.className = document.documentElement.className.replace( /(^|\s)client-nojs(\s|$)/, "$1client-js$2" );</script>
<script>(window.RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"Main_Page","wgTitle":"Main Page","wgCurRevisionId":2971,"wgRevisionId":2971,"wgArticleId":1,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":"Abwayax","wgUserGroups":["bureaucrat","checkuser","oversight","sysop","*","user","autoconfirmed"],"wgCategories":[],"wgBreakFrames":false,"wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgMonthNamesShort":["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"wgRelevantPageName":"Main_Page","wgRelevantArticleId":1,"wgRequestId":"0936324d3e0cda5e4c61ea58","wgUserId":96,"wgUserEditCount":60,"wgUserRegistration":1256777873000,"wgUserNewMsgRevisionId":null,"wgIsProbablyEditable":true,"wgRestrictionEdit":["sysop"],"wgRestrictionMove":["sysop"],"wgIsMainPage":true,"wgFlaggedRevsParams":{"tags":{"accuracy":{"levels":3,"quality":2,"pristine":4},"depth":{"levels":3,"quality":1,"pristine":4},"style":{"levels":3,"quality":1,"pristine":4}}},"wgStableRevisionId":2971});mw.loader.implement("user.options",function($,jQuery,require,module){mw.user.options.set({"watchlisttoken":"3053cf53a0c446121a8da2e4bfb11fbc4de99a68"});});mw.loader.implement("user.tokens",function ( $, jQuery, require, module ) {
mw.user.tokens.set({"editToken":"+\\","patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"});/*@nomin*/;

});mw.loader.load(["mediawiki.page.startup"]);});</script>
<link rel="stylesheet" href="/w/load.php?debug=false&amp;lang=en&amp;modules=ext.flaggedRevs.basic%7Cmediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.sectionAnchor&amp;only=styles&amp;skin=gcl3"/>
<link rel="stylesheet" href="/w/skins/GCL3/main.css?303" media="screen"/><!--[if lt IE 5.5000]><link rel="stylesheet" href="/w/skins/GCL3/IE50Fixes.css?303" media="screen"/><![endif]--><!--[if IE 5.5000]><link rel="stylesheet" href="/w/skins/GCL3/IE55Fixes.css?303" media="screen"/><![endif]--><!--[if IE 6]><link rel="stylesheet" href="/w/skins/GCL3/IE60Fixes.css?303" media="screen"/><![endif]--><!--[if IE 7]><link rel="stylesheet" href="/w/skins/GCL3/IE70Fixes.css?303" media="screen"/><![endif]-->
<meta name="ResourceLoaderDynamicStyles" content=""/>
<script async="" src="/w/load.php?debug=false&amp;lang=en&amp;modules=startup&amp;only=scripts&amp;skin=gcl3"></script>
<meta name="generator" content="MediaWiki 1.27.0"/>
<link rel="alternate" type="application/x-wiki" title="Edit" href="/w/index.php?title=Main_Page&amp;action=edit"/>
<link rel="edit" title="Edit" href="/w/index.php?title=Main_Page&amp;action=edit"/>
<link rel="shortcut icon" href="/favicon.ico"/>
<link rel="search" type="application/opensearchdescription+xml" href="/w/opensearch_desc.php" title="Glitch City Laboratories (en)"/>
<link rel="EditURI" type="application/rsd+xml" href="//glitchcity.info/w/api.php?action=rsd"/>
<link rel="alternate" type="application/atom+xml" title="Glitch City Laboratories Atom feed" href="/w/index.php?title=Special:RecentChanges&amp;feed=atom"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<link rel="stylesheet" type="text/css" href="http://forums.glitchcity.info/Themes/GCL3/css/index.css?rc5" />
	<script type="text/javascript" src="http://forums.glitchcity.info/Themes/default/scripts/script.js?rc5"></script>
	<script type="text/javascript" src="http://forums.glitchcity.info/Themes/GCL3/scripts/theme.js?rc5"></script>
	<script type="text/javascript"><!-- // --><![CDATA[
		var smf_theme_url = "http://forums.glitchcity.info/Themes/GCL3";
		var smf_default_theme_url = "http://forums.glitchcity.info/Themes/default";
		var smf_images_url = "http://forums.glitchcity.info/Themes/GCL3/images";
		var smf_scripturl = "http://forums.glitchcity.info/index.php";
		var smf_iso_case_folding = false;
		var smf_charset = "UTF-8";
		var ajax_notification_text = "Loading...";
		var ajax_notification_cancel_text = "Cancel";
	// ]]></script>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	<meta name="description" content="" />
	<title></title>
	<link rel="help" href="http://forums.glitchcity.info/index.php?action=help" />
	<link rel="search" href="http://forums.glitchcity.info/index.php?action=search" />
	<link rel="contents" href="http://forums.glitchcity.info/index.php" />
	<link rel="alternate" type="application/rss+xml" title="Glitch City Laboratories Forums - RSS" href="http://forums.glitchcity.info/index.php?type=rss;action=.xml" />
</head>
<body>
<body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-Main_Page rootpage-Main_Page skin-GCL3 action-view">
``` <!DOCTYPE html> <html lang="en" dir="ltr" class="client-nojs"> <head> <meta charset="UTF-8"/> <title>Glitch City Laboratories</title> <script>document.documentElement.className = document.documentElement.className.replace( /(^|\s)client-nojs(\s|$)/, "$1client-js$2" );</script> <script>(window.RLQ=window.RLQ||[]).push(function(){mw.config.set({"wgCanonicalNamespace":"","wgCanonicalSpecialPageName":false,"wgNamespaceNumber":0,"wgPageName":"Main_Page","wgTitle":"Main Page","wgCurRevisionId":2971,"wgRevisionId":2971,"wgArticleId":1,"wgIsArticle":true,"wgIsRedirect":false,"wgAction":"view","wgUserName":"Abwayax","wgUserGroups":["bureaucrat","checkuser","oversight","sysop","*","user","autoconfirmed"],"wgCategories":[],"wgBreakFrames":false,"wgPageContentLanguage":"en","wgPageContentModel":"wikitext","wgSeparatorTransformTable":["",""],"wgDigitTransformTable":["",""],"wgDefaultDateFormat":"dmy","wgMonthNames":["","January","February","March","April","May","June","July","August","September","October","November","December"],"wgMonthNamesShort":["","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],"wgRelevantPageName":"Main_Page","wgRelevantArticleId":1,"wgRequestId":"0936324d3e0cda5e4c61ea58","wgUserId":96,"wgUserEditCount":60,"wgUserRegistration":1256777873000,"wgUserNewMsgRevisionId":null,"wgIsProbablyEditable":true,"wgRestrictionEdit":["sysop"],"wgRestrictionMove":["sysop"],"wgIsMainPage":true,"wgFlaggedRevsParams":{"tags":{"accuracy":{"levels":3,"quality":2,"pristine":4},"depth":{"levels":3,"quality":1,"pristine":4},"style":{"levels":3,"quality":1,"pristine":4}}},"wgStableRevisionId":2971});mw.loader.implement("user.options",function($,jQuery,require,module){mw.user.options.set({"watchlisttoken":"3053cf53a0c446121a8da2e4bfb11fbc4de99a68"});});mw.loader.implement("user.tokens",function ( $, jQuery, require, module ) { mw.user.tokens.set({"editToken":"+\\","patrolToken":"+\\","watchToken":"+\\","csrfToken":"+\\"});/*@nomin*/; });mw.loader.load(["mediawiki.page.startup"]);});</script> <link rel="stylesheet" href="/w/load.php?debug=false&amp;lang=en&amp;modules=ext.flaggedRevs.basic%7Cmediawiki.legacy.commonPrint%2Cshared%7Cmediawiki.sectionAnchor&amp;only=styles&amp;skin=gcl3"/> <link rel="stylesheet" href="/w/skins/GCL3/main.css?303" media="screen"/><!--[if lt IE 5.5000]><link rel="stylesheet" href="/w/skins/GCL3/IE50Fixes.css?303" media="screen"/><![endif]--><!--[if IE 5.5000]><link rel="stylesheet" href="/w/skins/GCL3/IE55Fixes.css?303" media="screen"/><![endif]--><!--[if IE 6]><link rel="stylesheet" href="/w/skins/GCL3/IE60Fixes.css?303" media="screen"/><![endif]--><!--[if IE 7]><link rel="stylesheet" href="/w/skins/GCL3/IE70Fixes.css?303" media="screen"/><![endif]--> <meta name="ResourceLoaderDynamicStyles" content=""/> <script async="" src="/w/load.php?debug=false&amp;lang=en&amp;modules=startup&amp;only=scripts&amp;skin=gcl3"></script> <meta name="generator" content="MediaWiki 1.27.0"/> <link rel="alternate" type="application/x-wiki" title="Edit" href="/w/index.php?title=Main_Page&amp;action=edit"/> <link rel="edit" title="Edit" href="/w/index.php?title=Main_Page&amp;action=edit"/> <link rel="shortcut icon" href="/favicon.ico"/> <link rel="search" type="application/opensearchdescription+xml" href="/w/opensearch_desc.php" title="Glitch City Laboratories (en)"/> <link rel="EditURI" type="application/rsd+xml" href="//glitchcity.info/w/api.php?action=rsd"/> <link rel="alternate" type="application/atom+xml" title="Glitch City Laboratories Atom feed" href="/w/index.php?title=Special:RecentChanges&amp;feed=atom"/> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <link rel="stylesheet" type="text/css" href="http://forums.glitchcity.info/Themes/GCL3/css/index.css?rc5" /> <script type="text/javascript" src="http://forums.glitchcity.info/Themes/default/scripts/script.js?rc5"></script> <script type="text/javascript" src="http://forums.glitchcity.info/Themes/GCL3/scripts/theme.js?rc5"></script> <script type="text/javascript"><!-- // --><![CDATA[ var smf_theme_url = "http://forums.glitchcity.info/Themes/GCL3"; var smf_default_theme_url = "http://forums.glitchcity.info/Themes/default"; var smf_images_url = "http://forums.glitchcity.info/Themes/GCL3/images"; var smf_scripturl = "http://forums.glitchcity.info/index.php"; var smf_iso_case_folding = false; var smf_charset = "UTF-8"; var ajax_notification_text = "Loading..."; var ajax_notification_cancel_text = "Cancel"; // ]]></script> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta name="description" content="" /> <title></title> <link rel="help" href="http://forums.glitchcity.info/index.php?action=help" /> <link rel="search" href="http://forums.glitchcity.info/index.php?action=search" /> <link rel="contents" href="http://forums.glitchcity.info/index.php" /> <link rel="alternate" type="application/rss+xml" title="Glitch City Laboratories Forums - RSS" href="http://forums.glitchcity.info/index.php?type=rss;action=.xml" /> </head> <body> <body class="mediawiki ltr sitedir-ltr ns-0 ns-subject page-Main_Page rootpage-Main_Page skin-GCL3 action-view"> ```
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.