[ 
https://issues.apache.org/jira/browse/SCB-930?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16621962#comment-16621962
 ] 

ASF GitHub Bot commented on SCB-930:
------------------------------------

asifdxtreme commented on a change in pull request #447: SCB-930 Make Regex more 
stringent to remove new line char from Schema
URL: 
https://github.com/apache/incubator-servicecomb-service-center/pull/447#discussion_r219150034
 
 

 ##########
 File path: frontend/app/scripts/modules/serviceCenter/controllers/schemaCtrl.js
 ##########
 @@ -146,7 +146,7 @@ angular.module('serviceCenter.sc')
                 httpService.apiRequest(url, method, null, headers, 
"nopopup").then(function(response) {
                     if (response && response.data && response.data.schema) {
                         $scope.template = response.data.schema;
-                        $scope.template = $scope.template.replace(/\\/g, "");
+                        $scope.template = $scope.template.replace(/\\\s/g, "");
 
 Review comment:
   This will replace the '\' character with nothing only when it is the last 
character in the line :  
   
   For Example : 
   ```
   description: "body返回: <br/>{\"body\":{},\"statusCode\":\"120\",\"errorMsg\" \
          :\"没有为此用户分配有效的坐席\"}"
   ```
   In this , it will just replace the last '\' in the first line, 
   after replacing it becomes
   ```
   description: "body返回: <br/>{\"body\":{},\"statusCode\":\"120\",\"errorMsg\" 
:\"没有为此用户分配有效的坐席\"}"
   ```
    

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Service Center Frontend stops responding in Schema test if Schema has '\"' 
> character in the description
> -------------------------------------------------------------------------------------------------------
>
>                 Key: SCB-930
>                 URL: https://issues.apache.org/jira/browse/SCB-930
>             Project: Apache ServiceComb
>          Issue Type: Bug
>          Components: Service-Center
>    Affects Versions: service-center-1.0.0
>            Reporter: Mohammad Asif Siddiqui
>            Assignee: Mohammad Asif Siddiqui
>            Priority: Major
>             Fix For: service-center-1.1.0
>
>
> Service Center Frontend stops responding in Schema test if Schema has '\"' 
> character in the description.
> Solution :  Update the Regex for eliminating the new line character



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to