Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix themes not displaying due to double video end tags #315

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions config/loader/hyperspin.nut
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,21 @@ for ( local i=0; i< fe.displays.len(); i++ )
// Functions definitions
//
/////////////////////////////////////////////////////////
function string_replace( string, original, replacement )
{
local result = string;
local position = 0;

position = result.find( original );
while ( position != null )
{
result = result.slice( 0, position) + replacement + result.slice(position + original.len() );
position = result.find( original );
}

return result;
}

function strip_ext( name )
{
local s = split( name, "." );
Expand Down Expand Up @@ -453,6 +468,13 @@ function load( ttype, match_map, hs_sys_dir )
while ( !f.eos() )
raw_xml = raw_xml + f.read_line();

//fix common error in a lot of themes with wrong end tags
raw_xml = string_replace( raw_xml, "start=\"none\"/>rest=", "start=\"none\"rest=" );
raw_xml = string_replace( raw_xml, "start=\"left\"/>rest=", "start=\"left\"rest=" );
raw_xml = string_replace( raw_xml, "start=\"top\"/>rest=", "start=\"top\"rest=" );
raw_xml = string_replace( raw_xml, "start=\"bottom\"/>rest=", "start=\"bottom\"rest=" );
raw_xml = string_replace( raw_xml, "start=\"right\"/>rest=", "start=\"right\"rest=" );

// root tag = "Theme"
local xml_root = null;
try
Expand Down