add code highlighting

This commit is contained in:
Dwsy 2023-02-15 11:09:17 +08:00 committed by Redon
parent 8dab963628
commit b2977d8c44
2 changed files with 1 additions and 12 deletions

2
.env
View File

@ -1,2 +1,2 @@
# Glob API URL
VITE_GLOB_API_URL='http://20.222.29.173:3002'
VITE_GLOB_API_URL='http://localhost:3002'

11
1.js
View File

@ -1,11 +0,0 @@
// String containing code snippets
let str = "let x = 10; console.log(x);"
// Create regex pattern
let regexp = /^(?:\s{4}|\t).+/gm
// Test if any code snippets were detected
if (str.match(regexp)) {
// Code snippet was detected, do something with it
console.log(str)
}