From 338d986fb868795d528f0d5485bb5efa30446866 Mon Sep 17 00:00:00 2001 From: Stefan Ritter Date: Sun, 6 Dec 2009 21:50:12 +0100 Subject: Making a wonderful place for regexp and added some more blockelements to the list --- blogthon.cgi | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/blogthon.cgi b/blogthon.cgi index a648abe..a9c4023 100755 --- a/blogthon.cgi +++ b/blogthon.cgi @@ -21,6 +21,9 @@ import cgi, os, time, glob, re, md5, sys, random, smtplib import ConfigParser +# A wonderful place for doing some regexp ;) +no_break = re.compile('^\s*(|
  • |
      |
    ||
    |||||||

    |

    ).*$') + def generate_uuid(string): string_md5sum = md5.new(string).hexdigest() string = str.join('-', (string_md5sum[0:8], string_md5sum[8:12], string_md5sum[12:16], string_md5sum[16:20], string_md5sum[20:32])) @@ -407,7 +410,7 @@ else: print '
    ' print '

    ' for line in content: - if re.search('

  • ', line) or re.search('', line) or re.search('
      ', line) or re.search('
    ', line): + if re.match(no_break, line): print ' ' + line.strip() else: print ' ' + line.strip() + '
    ' @@ -443,7 +446,6 @@ else: print ' ' print '
    ' for line in content: - no_break = re.compile('^.*(
      |
    |
  • |
      |
    ||
    ||||).*$') if re.match(no_break, line): print ' ' + line.strip() else: -- cgit v1.2.3