Generic Syntax Highlighter You are reading Tutorial from Thichnet Blog Generic Syntax Highlighter <!-- comment --> <div class="foo" id="bar" title="foo \"bar \\\" ba\'z qux"> <p>lorem ipsum &amp; dolor sit</p> </div> <!DOCTYPE html> <html dir="ltr"> <head> <!-- comment --> <title>Test</title> <style> #foo {color:red} .bar {color:#fff} </style> <?php # do header ... echo do_header($_GET['foo']); ?> </head> <body> <script> // inline comment function foo(bar) { var v = /\s 123 true function\//g; var w = <mark>"foo" + 4</mark>; var x = true; var y = 4 + 5 + 1.5 + .4; var z = `<div> <div></div> </div>`; /** * block comment */ return "string" + 'string' + "string \" str\'ing" + 'string \' str\"ing' + "" + ''; } </script> </body> </html> Known Bugs PHP tags in HTML attributes: <article id="post-<?php echo $post->id; ?>"> Currently not targeted for highlighting CSS syntax. Previous Next Home
Generic Syntax Highlighter You are reading Tutorial from Thichnet Blog Generic Syntax Highlighter <!-- comment --> <div class="foo" id="bar" title="foo \"bar \\\" ba\'z qux"> <p>lorem ipsum &amp; dolor sit</p> </div> <!DOCTYPE html> <html dir="ltr"> <head> <!-- comment --> <title>Test</title> <style> #foo {color:red} .bar {color:#fff} </style> <?php # do header ... echo do_header($_GET['foo']); ?> </head> <body> <script> // inline comment function foo(bar) { var v = /\s 123 true function\//g; var w = <mark>"foo" + 4</mark>; var x = true; var y = 4 + 5 + 1.5 + .4; var z = `<div> <div></div> </div>`; /** * block comment */ return "string" + 'string' + "string \" str\'ing" + 'string \' str\"ing' + "" + ''; } </script> </body> </html> Known Bugs PHP tags in HTML attributes: <article id="post-<?php echo $post->id; ?>"> Currently not targeted for highlighting CSS syntax.