diff --git a/src/var/lib/tyto/program/wip.py b/src/var/lib/tyto/program/wip.py index d394f6b..cb485bc 100644 --- a/src/var/lib/tyto/program/wip.py +++ b/src/var/lib/tyto/program/wip.py @@ -129,8 +129,8 @@ def wip_begin_markers(wip_lines): ['^>>\s' , '' , True ], [r'^\($|\(\s' , '

' , True ], ['^\)$|^\)\s' , '

' , False], - ['^\[\[$|^\[\[\s' , '' , False] + ['^\[\[$|^\[\[\s' , '
'          , False]
                ]
 
   for line in wip_lines:
@@ -448,26 +448,34 @@ def convert_bcodes(article, fm, lm, css):
   article_temp = ''
   bCode        = False
   bCode_lines  = ''
+  bCode_ln     = 0
   
   for line in article:    
     if line.startswith(fm):
       bCode        = True
-      article_temp = '%s%s\n'%(article_temp, line)
+      article_temp = '%s\n%s'%(article_temp, line)
       continue
     
     if line.startswith(lm):
       bCode    = False
       
-      #print(bCode_lines)
+      print(bCode_lines)
       convert_to_b64(bCode_lines)
       bCode_lines  = ''
-      article_temp = '%s%s\n%s\n'%(
+      article_temp = '%s\n%s\n%s'%(
                       article_temp, b64_content, line
                       )
       continue
   
-    if bCode: bCode_lines  = '%s%s\n'%(bCode_lines, line)
-    else    : article_temp = '%s%s\n'%(article_temp, line)
+    if bCode:
+      bCode_ln += 1
+      line = '  %s%s'%(
+              bCode_ln, line
+              )
+      if bCode_lines: bCode_lines = '%s\n%s'%(bCode_lines, line)
+      else          : bCode_lines = line
+    else:
+      article_temp = '%s\n%s'%(article_temp, line)
 
 #====================================#
 # Protect bCodes contents to base64  #