From 0026ca48c2800425ea5018b2626c390114aea68f Mon Sep 17 00:00:00 2001 From: Zach DeCook Date: Sun, 11 Mar 2018 18:46:00 -0400 Subject: * Meta Parsing: Allow {Key:C} tags --- page.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/page.php b/page.php index a3fb4c5..cdc7921 100644 --- a/page.php +++ b/page.php @@ -25,6 +25,7 @@ function toc(){ $toc .= "
  • " . $line . ""; } if( preg_match("/^{Verse: ?(.*)}/i", $line, $matches)) $toc .= " ($matches[1])"; + if( preg_match("/^{Key: ?(.*)}/i", $line, $matches)) $toc .= " ($matches[1])"; if( preg_match("(^{p\d+(\(\S\S?\S?\))?})", $line)) $toc .= " (Reviewed)"; if( preg_match( "/\{p?\d*\((.+m?)\)\}/", $line, $matches) ) $toc .= " ($matches[1])"; @@ -98,11 +99,13 @@ function load_song( $number, $transp = 0 ) } } - if( preg_match( "/\{p?\d*\((.+m?)\)\}/", $line, $matches) ) + if ( preg_match( "/\{p?\d*\((.+m?)\)\}/", $line, $matches) + || preg_match("/^{Key: ?(.*)}/i", $line, $matches) + ) { if ( isset( $suggestedSong[$current_song])) { - $suggestedSong[$current_song]['key'] = $matches[1]; + $suggestedSong[$current_song]['key'] = $matches[1]; } if ( $current_song === $number ) { -- cgit 1.4.1