mirror of
https://github.com/Chanzhaoyu/chatgpt-web.git
synced 2025-07-21 03:44:21 +00:00
add code highlighting
This commit is contained in:
2
.env
2
.env
@@ -1,2 +1,2 @@
|
|||||||
# Glob API URL
|
# Glob API URL
|
||||||
VITE_GLOB_API_URL='http://20.222.29.173:3002'
|
VITE_GLOB_API_URL='http://localhost:3002'
|
11
1.js
11
1.js
@@ -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)
|
|
||||||
}
|
|
Reference in New Issue
Block a user