mirror of
https://github.com/mgerb/mywebsite
synced 2026-01-12 18:52:50 +00:00
Added files
This commit is contained in:
25
mongoui/mongoui-master/node_modules/highlight/examples/test.js
generated
vendored
Normal file
25
mongoui/mongoui-master/node_modules/highlight/examples/test.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
|
||||
var hl = require("../lib/highlight.js").Highlight,
|
||||
code_string = "<?php\r\n"+
|
||||
"\techo \"Hello world!\";\r\n"+
|
||||
"\tfor($i=0;$i<100;$i++){\r\n"+
|
||||
"\t\techo \"$i\";\r\n"+
|
||||
"\t}\r\n"+
|
||||
"?>",
|
||||
|
||||
code_block = "<p>PHP code:</p>\n"+
|
||||
"<code><?php\n"+
|
||||
"\techo \"Hello world!\";\n"+
|
||||
"\tfor($i=0;$i<100;$i++){\n"+
|
||||
"\t\techo \"$i\";\n"+
|
||||
"\t}\n"+
|
||||
"?></code>",
|
||||
|
||||
html1 = hl(code_string), // convert all
|
||||
html2 = hl(code_string,' '), // convert with special tab replacer
|
||||
html3 = hl(code_block, false, true); // convert only inside <code/>
|
||||
|
||||
console.log(html1);
|
||||
console.log(html2);
|
||||
console.log(html3);
|
||||
Reference in New Issue
Block a user