package org.opendroidphp.app.common.utils;

public class ShellOutputFormatter {

    public static String toHTML(String mString) {

        String templateView = "</style>.prettyprint {\n" +
                "        padding: 8px;\n" +
                "        background-color: #f7f7f9;\n" +
                "        border: 1px solid #e1e1e8;\n" +
                "        }</style>" + "<pre class=\"prettyprint\">Hell</pre>";
        /**
         * Replace all repeating whitespace with one single whitespace
         */

        mString = mString.replaceAll("\\s+", " ");
        // String[] mArrStr = mString.split("\n");
        // String s = "";
        // for (int i = 0; i < mArrStr.length; i++) {
        mString = "<strong>" + mString.trim() + "</strong><br/>";

        // }
        return mString.trim();

    }

}

@@ -37,16 +37,42 @@
 utils;%0A%0A
+import java.util.Locale;%0A%0A
 public c
@@ -143,315 +143,22 @@
 ing 
-mString) %7B%0A%0A        String templateView = %22%3C/style%3E.prettyprint %7B%5Cn%22 +%0A                %22        padding: 8px;%5Cn%22 +%0A                %22        background-color: #f7f7f9;%5Cn%22 +%0A                %22        border: 1px solid #e1e1e8;%5Cn%22 +%0A                %22        %7D%3C/style%3E%22 + %22%3Cpre class=%5C%22prettyprint%5C%22%3EHell%3C/pre%3E%22;
+fromOutput) %7B%0A
 %0A   
@@ -262,25 +262,31 @@
     
-mString = mString
+fromOutput = fromOutput
 .rep
@@ -319,239 +319,55 @@
     
-// String%5B%5D mArrStr = mString.split(%22%5Cn%22);%0A        // String s = %22%22;%0A        // for (int i = 0; i %3C mArrStr.length; i++) %7B%0A        mString = %22%3Cstrong%3E%22 + mString.trim() + %22%3C/strong%3E%3Cbr/%3E%22;%0A%0A        // %7D%0A        return mString.trim(
+return String.format(Locale.ENGLISH, fromOutput
 );%0A%0A

revert to simpler implementation