includes/render.php
changeset 1230 31d226269d2f
parent 1227 bdac73ed481e
child 1308 f9bee9b125ee
equal deleted inserted replaced
1228:9e9334417dbc 1230:31d226269d2f
   572 		return base64_encode($text);
   572 		return base64_encode($text);
   573 	}
   573 	}
   574 	
   574 	
   575 	public static function reverse_process_headings($text)
   575 	public static function reverse_process_headings($text)
   576 	{
   576 	{
   577 		if ( !preg_match_all('|^<h([1-6])(?: id="toc[0-9]+")?>(.*?)</h\\1>$|m', $text, $matches) )
   577 		if ( !preg_match_all('|^<h([1-6])(?: id="head:[\w\.\/:;\(\)@\[\]=_-]+")?>(.*?)</h\\1>$|m', $text, $matches) )
   578 			return $text;
   578 			return $text;
   579 		
   579 		
   580 		foreach ( $matches[0] as $i => $match )
   580 		foreach ( $matches[0] as $i => $match )
   581 		{
   581 		{
   582 			// generate heading tag
   582 			// generate heading tag