[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r3521 - usemod2trac
From: |
eb |
Subject: |
[Commit-gnuradio] r3521 - usemod2trac |
Date: |
Mon, 11 Sep 2006 12:53:51 -0600 (MDT) |
Author: eb
Date: 2006-09-11 12:53:50 -0600 (Mon, 11 Sep 2006)
New Revision: 3521
Modified:
usemod2trac/convert_usemod_to_trac.py
Log:
work-in-progress
Modified: usemod2trac/convert_usemod_to_trac.py
===================================================================
--- usemod2trac/convert_usemod_to_trac.py 2006-09-11 06:38:09 UTC (rev
3520)
+++ usemod2trac/convert_usemod_to_trac.py 2006-09-11 18:53:50 UTC (rev
3521)
@@ -72,9 +72,34 @@
s = code_re.sub(mo_group(1, store_pre), s)
# The <pre> tag stores text with no {{{ markup }}}
s = pre_re.sub(mo_group(1, store_pre), s)
+
+ s = re.sub(r'(?i)<b>(.*?)</b>', "'''\\1'''", s)
+ s = re.sub(r'(?i)<i>(.*?)</i>', "''\\1''", s)
+ s = re.sub(r'(?i)<strong>(.*?)</strong>', "'''\\1'''", s)
+ s = re.sub(r'(?i)<em>(.*?)</em>', "''\\1''", s)
+ s = re.sub(r'(?i)<br>', lambda mo: store_raw('[[BR]]'), s)
+
return s
+def handle_single_line_markup(page):
+ r = []
+ for s in page.split('\n'):
+ r.append(handle_one_line(s))
+
+ return '\n'.join(r)
+
+
+def handle_one_line(s):
+ # check for "definition list"
+ #mo = re.match(r'^(;+)([^:]+):', s)
+ #if mo:
+ # depth = len(mo.group(1))
+ # tag = mo.group(2)
+
+ return s
+
+
def convert_1(input_filename, output_filename):
ifile = open(input_filename, 'r')
ofile = open(output_filename, 'w')
@@ -85,7 +110,8 @@
s = re.sub(r'\\ *\n', ' ', s)
s = handle_multiline_markup(s)
-
+ s = handle_single_line_markup(s)
+
s = restore_saved_text(s)
ofile.write(s)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r3521 - usemod2trac,
eb <=