Skip to content

Instantly share code, notes, and snippets.

@EHLOVader
Last active July 3, 2017 15:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save EHLOVader/6611930 to your computer and use it in GitHub Desktop.
Save EHLOVader/6611930 to your computer and use it in GitHub Desktop.
Syntax highlighting test with HTML PHP and some tricky bits for testing that a highlighter is doing things right.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Text Highlight Demo</title>
<script type="text/javascript">
jQuery(function($,undefined){
var Sublime = {
"theme": "Flatland Dark.sublime-theme",
"color_scheme": "Packages/Monokai Extended/Monokai Extended.tmTheme",
"font_face": "Anonymous Pro",
"font_size": 8
};
});
</script>
</head>
<body>
<?php
$pattern = '(<body[^>]*?>';
/* abcdef
multi-line
*/
$hello = <<<HELLO
<<<<--! jk -->
>>>
/*
1Il|iO0oB8
HELLO;
function echoit($pattern) {
$complex = new stdClass();
$complex->pattern = array( 3 => $pattern);
foreach (array(1,2,3) as $val) {
echo $val;
}
echo "123 456 $pattern {$complex->pattern[$val]}";
echo '123 456 $pattern {$complex->pattern[$val]}';
}
echo "/*";
echo '//';echoit($pattern);
?>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment