You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zeppelin.apache.org by GitBox <gi...@apache.org> on 2019/02/04 04:15:07 UTC

[GitHub] Leemoonsoo commented on a change in pull request #3302: [ZEPPELIN-3988] Paragraph Text output includes \r\n is not displayed correctly.

Leemoonsoo commented on a change in pull request #3302: [ZEPPELIN-3988] Paragraph Text output includes \r\n is not displayed correctly.
URL: https://github.com/apache/zeppelin/pull/3302#discussion_r253344252
 
 

 ##########
 File path: zeppelin-web/src/app/notebook/paragraph/result/result.controller.js
 ##########
 @@ -488,22 +489,7 @@ function ResultCtrl($scope, $rootScope, $route, $window, $routeParams, $location
   };
 
   const checkAndReplaceCarriageReturn = function(str) {
-    if (/\r/.test(str)) {
-      let newGenerated = '';
-      let strArr = str.split('\n');
-      for (let str of strArr) {
-        if (/\r/.test(str)) {
-          let splitCR = str.split('\r');
-          newGenerated += splitCR[splitCR.length - 1] + '\n';
-        } else {
-          newGenerated += str + '\n';
-        }
-      }
-      // remove last "\n" character
-      return newGenerated.slice(0, -1);
-    } else {
-      return str;
-    }
 
 Review comment:
   Reason implementation of `checkAndReplaceCarriageReturn` moved to new class is for testability.
   Controller method is hard to test. Unless method is referenced by `$scope`

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services