fix syntax highlighter
This commit is contained in:
		@@ -402,29 +402,24 @@ class frontend{
 | 
			
		||||
		
 | 
			
		||||
		$text =
 | 
			
		||||
			trim(
 | 
			
		||||
				preg_replace(
 | 
			
		||||
					'/<\/span>$/',
 | 
			
		||||
					"", // remove stray ending span because of the <?php stuff
 | 
			
		||||
					str_replace(
 | 
			
		||||
						[
 | 
			
		||||
							'<br />',
 | 
			
		||||
							' '
 | 
			
		||||
						],
 | 
			
		||||
						[
 | 
			
		||||
							"\n", // replace <br> with newlines
 | 
			
		||||
							" " // replace html entity to space
 | 
			
		||||
						],
 | 
			
		||||
						str_replace(
 | 
			
		||||
							[
 | 
			
		||||
								// leading <?php garbage
 | 
			
		||||
								"<span style=\"color: c-default\">\n<?php ",
 | 
			
		||||
								"<code>",
 | 
			
		||||
								"</code>"
 | 
			
		||||
							],
 | 
			
		||||
							"",
 | 
			
		||||
							highlight_string("<?php " . $text, true)
 | 
			
		||||
						)
 | 
			
		||||
					)
 | 
			
		||||
				str_replace(
 | 
			
		||||
					[
 | 
			
		||||
						"<br />",
 | 
			
		||||
						" ",
 | 
			
		||||
						"<pre>",
 | 
			
		||||
						"</pre>"
 | 
			
		||||
					],
 | 
			
		||||
					[
 | 
			
		||||
						"\n",
 | 
			
		||||
						" ",
 | 
			
		||||
						"",
 | 
			
		||||
						""
 | 
			
		||||
					],
 | 
			
		||||
					explode(
 | 
			
		||||
						"<?php",
 | 
			
		||||
						highlight_string("<?php " . $text, true),
 | 
			
		||||
						2
 | 
			
		||||
					)[1]
 | 
			
		||||
				)
 | 
			
		||||
			);
 | 
			
		||||
		
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user