ecere/sys/JSON: Adding a new line after <br>
authorJerome St-Louis <jerome@ecere.com>
Sat, 22 Oct 2016 18:41:16 +0000 (14:41 -0400)
committerJerome St-Louis <jerome@ecere.com>
Sat, 22 Oct 2016 18:52:33 +0000 (14:52 -0400)
- Avoiding unwanted differences in docs from how they were imported

doc/ecereCOM/char-pointer.econ
ecere/src/sys/JSON.ec

index 34692ee..08f2c2d 100644 (file)
@@ -16,7 +16,7 @@
       "   void Main()<br>"
       "   {<br>"
       "      char * helloString = \"Hello, World!\";<br>"
-      "      printf(\"%s\<br>\", helloString);<br>"
+      "      printf(\"%s\\n\", helloString);<br>"
       "   }<br>"
       "}<br>"
       "<br>"
index 3311454..cc793b7 100644 (file)
@@ -1479,6 +1479,17 @@ static bool WriteValue(File f, Class type, DataValue value, int indent, bool eCO
                   f.Puts("\\t");
                   b = 0;
                }
+               else if(c >= 4 && ch == '>' && string[c-2] == 'r' && string[c-3] == 'b' && string[c-4] == '<')
+               {
+                  // Add an automatic newline for <br> as this is how we imported documentor data...
+                  int i;
+                  buffer[b] = 0;
+                  f.Puts(buffer);
+                  f.Puts(">\"\n");
+                  for(i = 0; i<indent; i++) f.Puts("   ");
+                  f.Puts("   \"");
+                  b = 0;
+               }
                else if(ch == '\n')
                {
                   int i;