fixes
Showing
1 changed file
with
4 additions
and
6 deletions
| ... | @@ -64,17 +64,15 @@ function App() { | ... | @@ -64,17 +64,15 @@ function App() { |
| 64 | const programmingKeywords = ['code', 'application', 'controller', 'rails' , 'PHP', 'java', 'javascript', 'script', 'console', 'python', 'programming', 'table']; | 64 | const programmingKeywords = ['code', 'application', 'controller', 'rails' , 'PHP', 'java', 'javascript', 'script', 'console', 'python', 'programming', 'table']; |
| 65 | 65 | ||
| 66 | const regex = new RegExp(`\\b(${programmingKeywords.join('|')})\\b`, 'gi'); | 66 | const regex = new RegExp(`\\b(${programmingKeywords.join('|')})\\b`, 'gi'); |
| 67 | console.log(regex) | 67 | // console.log(regex) |
| 68 | const matches = parsedData.match(regex); | 68 | const matches = parsedData.match(regex); |
| 69 | console.log(matches); | 69 | // console.log(matches); |
| 70 | if (!matches) { | 70 | if (!matches) { |
| 71 | var replaceTags = (parsedData.replace(/(?:\r\n|\r|\n)/g, '<br>').replace(/\./g, '. ')) | 71 | var replaceTags = (parsedData.replace(/(?:\r\n|\r|\n)/g, '<br>').replace(/\./g, '. ')) |
| 72 | console.log("not programming!") | 72 | // console.log("not programming!") |
| 73 | // return replaceTags | ||
| 74 | } else { | 73 | } else { |
| 75 | replaceTags = (parsedData.replace(':',':<code>').replace('<?','<?').replace('?>','?>').replace(/\n/g, '<br>')) | 74 | replaceTags = (parsedData.replace(':',':<code>').replace('<?','<?').replace('?>','?>').replace(/\n/g, '<br>')) |
| 76 | console.log("programming!") | 75 | // console.log("programming!") |
| 77 | // return replaceTags | ||
| 78 | //.replace('<?','<' + '?').replace('?>','?'+'>') | 76 | //.replace('<?','<' + '?').replace('?>','?'+'>') |
| 79 | } | 77 | } |
| 80 | setChatLog([...chatLogNew, { user: "gpt", message: `${replaceTags}`} ]) | 78 | setChatLog([...chatLogNew, { user: "gpt", message: `${replaceTags}`} ]) | ... | ... |
-
Please register or sign in to post a comment