Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /leo/plugins/rst3.py

leo
Discussion topic

Back to topic list

CVS update: /leo/plugins/rst3.py

Author plumloco
Full name Robert Ledger
Date 2008-01-10 04:49:56 PST
Message User: plumloco
Date: 2008-01-10 04:49:56-0800
Log:
 add patch to set page titles

File Changes:

Directory: /leo/plugins/
========================

File [changed]: rst3.py
Url: http://leo.tigris.or​g/source/browse/leo/​plugins/rst3.py?r1=1​.37&r2=1.38
Delta lines: +14 -0
--------------------
--- rst3.py 2007-12-13 04:43:30-0800 1.37
+++ rst3.py 2008-01-10 04:49:53-0800 1.38
@@ -1235,6 +1235,20 @@
             ok = False
 
         if ok:
+ if isHtml:
+ import re
+ idxTitle = output.find('<tit​le></title>​')
+ if idxTitle > -1:
+ m = re.search('<h1​>([^<]*)</h1​>', output)
+ if not m:
+ m = re.search('<h1​><[^>]+>([^​<]*)</a>​</h1>', output)
+ if m:
+ output = output.replace(
+ '<title></title>',
+ '<title>%s</title>' % m.group(1)
+ )
+
+
             if toString:
                 self.stringOutput = output
             else:

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: /leo/plugins/rst3.py plumloco Robert Ledger 2008-01-10 04:49:56 PST
Messages per page: