fixed coding style + minor changes
[smdp.git] / src / parser.c
index d81a2cb..f0d4ed3 100644 (file)
@@ -90,8 +90,9 @@ deck_t *markdown_load(FILE *input) {
                 sc++;
 
             } else if(CHECK_BIT(bits, IS_TILDE_CODE) && CHECK_BIT(bits, IS_EMPTY)) {
-               // remove tilde code markers
-               (text->reset)(text);
+                // remove tilde code markers
+                (text->reset)(text);
+
             } else {
 
                 // if slide ! has line
@@ -346,23 +347,23 @@ int markdown_analyse(cstring_t *text, int prev) {
 
     // IS_TILDE_CODE
     if (wcsncmp(text->value, L"~~~", 3) == 0) {
-           int tildes_in_line = next_nontilde(text, 0);
-           if (tildes_in_line >= num_tilde_characters) {
-                   if (num_tilde_characters > 0) {
-                           num_tilde_characters = 0;
-                   } else {
-                           num_tilde_characters = tildes_in_line;
-                   }
-                   SET_BIT(bits, IS_EMPTY);
-                   SET_BIT(bits, IS_TILDE_CODE);
-                   return bits;
-           }
+        int tildes_in_line = next_nontilde(text, 0);
+        if (tildes_in_line >= num_tilde_characters) {
+            if (num_tilde_characters > 0) {
+                num_tilde_characters = 0;
+            } else {
+                num_tilde_characters = tildes_in_line;
+            }
+            SET_BIT(bits, IS_EMPTY);
+            SET_BIT(bits, IS_TILDE_CODE);
+            return bits;
+        }
     }
 
     if (num_tilde_characters > 0) {
-           SET_BIT(bits, IS_CODE);
-           SET_BIT(bits, IS_TILDE_CODE);
-           return bits;
+        SET_BIT(bits, IS_CODE);
+        SET_BIT(bits, IS_TILDE_CODE);
+        return bits;
     }
 
     // IS_STOP
@@ -647,7 +648,6 @@ int next_nonblank(cstring_t *text, int i) {
     return i;
 }
 
-
 int prev_blank(cstring_t *text, int i) {
     while ((i > 0) && !iswspace((text->value)[i]))
         i--;