diff --git a/py-scripts/tools/lf_json_convert.py b/py-scripts/tools/lf_json_convert.py index 5f188d44..80f47a60 100755 --- a/py-scripts/tools/lf_json_convert.py +++ b/py-scripts/tools/lf_json_convert.py @@ -21,11 +21,13 @@ class file_convert(): file_fd = open(self.file, 'r') file2_fd = open(self.file2, 'w+') file2_fd.write('{\n') - file2_fd.write('"text": [ "
{",')
+        file2_fd.write('"text": [ "**{}**\\n",'.format(self.file))
         for line in file_fd:
-            #print(line)
             line = line.replace('"','"').replace('\n','')
+            # to avoid --raw_line \"  issues the \" it creates a \& which the reader does not like
+            line = line.replace('\&','\\\&')
             line = '"' + line + '\\n",'
+
             file2_fd.write('{}\n'.format(line))
         file2_fd.write('""]\n')
         file2_fd.write('},')
@@ -40,6 +42,7 @@ def main():
         formatter_class=argparse.RawTextHelpFormatter,
         epilog='''\
         lf_json_convert.py converts json for cookbook the output is _edit
+        NOTE: CANNOT have extra blank lines at the end of the json to display correctly.
 
             ''',
         description='''\