@@ -867,57 +867,12 @@ function parseReview(
867
867
let currentStartLine : number | null = null
868
868
let currentEndLine : number | null = null
869
869
let currentComment = ''
870
-
871
- function removeLineNumbersFromSuggestion ( comment : string ) : string {
872
- const suggestionStart = '```suggestion'
873
- const suggestionEnd = '```'
874
- let suggestionStartIndex = comment . indexOf ( suggestionStart )
875
-
876
- while ( suggestionStartIndex !== - 1 ) {
877
- const suggestionEndIndex = comment . indexOf (
878
- suggestionEnd ,
879
- suggestionStartIndex
880
- )
881
-
882
- if ( suggestionEndIndex === - 1 ) {
883
- // Break the loop if the closing delimiter is not found
884
- break
885
- }
886
-
887
- const suggestionBlock = comment . substring (
888
- suggestionStartIndex + suggestionStart . length ,
889
- suggestionEndIndex
890
- )
891
- const lineNumberRegex = / ^ \s * \d + : \s + /
892
-
893
- const sanitizedBlock = suggestionBlock
894
- . split ( '\n' )
895
- . map ( line => line . replace ( lineNumberRegex , '' ) )
896
- . join ( '\n' )
897
-
898
- comment =
899
- comment . substring ( 0 , suggestionStartIndex + suggestionStart . length ) +
900
- sanitizedBlock +
901
- comment . substring ( suggestionEndIndex )
902
-
903
- suggestionStartIndex = comment . indexOf (
904
- suggestionStart ,
905
- suggestionEndIndex + suggestionEnd . length
906
- )
907
- }
908
-
909
- return comment
910
- }
911
-
912
870
function storeReview ( ) : void {
913
871
if ( currentStartLine !== null && currentEndLine !== null ) {
914
- const sanitizedComment = removeLineNumbersFromSuggestion (
915
- currentComment . trim ( )
916
- )
917
872
const review : Review = {
918
873
start_line : currentStartLine ,
919
874
end_line : currentEndLine ,
920
- comment : sanitizedComment . trim ( )
875
+ comment : currentComment . trim ( )
921
876
}
922
877
923
878
let within_patch = false
0 commit comments