Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Administrator
/
chatgpt.ai-pro.org
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
3
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
33b89a1e
authored
2023-02-07 07:47:13 +0800
by
RSA
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fixes
1 parent
b0078561
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
client/src/App.js
client/src/App.js
View file @
33b89a1
...
...
@@ -64,17 +64,15 @@ function App() {
const
programmingKeywords
=
[
'code'
,
'application'
,
'controller'
,
'rails'
,
'PHP'
,
'java'
,
'javascript'
,
'script'
,
'console'
,
'python'
,
'programming'
,
'table'
];
const
regex
=
new
RegExp
(
`\\b(
${
programmingKeywords
.
join
(
'|'
)}
)\\b`
,
'gi'
);
console
.
log
(
regex
)
//
console.log(regex)
const
matches
=
parsedData
.
match
(
regex
);
console
.
log
(
matches
);
//
console.log(matches);
if
(
!
matches
)
{
var
replaceTags
=
(
parsedData
.
replace
(
/
(?:\r\n
|
\r
|
\n)
/g
,
'<br>'
).
replace
(
/
\.
/g
,
'. '
))
console
.
log
(
"not programming!"
)
// return replaceTags
// console.log("not programming!")
}
else
{
replaceTags
=
(
parsedData
.
replace
(
':'
,
':<code>'
).
replace
(
'<?'
,
'<?'
).
replace
(
'?>'
,
'?>'
).
replace
(
/
\n
/g
,
'<br>'
))
console
.
log
(
"programming!"
)
// return replaceTags
// console.log("programming!")
//.replace('<?','<' + '?').replace('?>','?'+'>')
}
setChatLog
([...
chatLogNew
,
{
user
:
"gpt"
,
message
:
`
${
replaceTags
}
`
}
])
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment