Skip to content

Commit

Permalink
more cases add to clean_code_blocks to remove weird strings that caus…
Browse files Browse the repository at this point in the history
…es mis-execution
  • Loading branch information
al2na committed Dec 21, 2023
1 parent 0913d15 commit b39c15e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions R/clean_code_blocks.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ clean_code_blocks<-function(response){
response<-gsub("```bash", "```", response)
response<-gsub("```\\{r\\}", "```", response)
response<-gsub("```\\{R\\}", "```", response)
response<-gsub("```\\{(R|r),\\s*eval=(FALSE|TRUE)\\}", "```",response)


# clean of possible output text
response<-gsub("\n\\[[0-9]+\\].*\n","",response)
Expand Down

0 comments on commit b39c15e

Please sign in to comment.