Changeset 130:618943a87b70
- Timestamp:
- 2007-08-03 04:02:41
(1 year ago)
- Author:
- Stefan Schwarzer <sschwarzer@sschwarzer.net>
- branch:
- default
- Message:
Limit `replace` to change only one occurence of the document root.
This helps in the unprobable situation where the string representing
the root occurs a second time in the path.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r127 |
r130 |
|
| 135 | 135 | html_parts.append(u' %s ' % arg) |
|---|
| 136 | 136 | else: |
|---|
| 137 | | old_url = path.replace(config.root, "") or "/" |
|---|
| | 137 | old_url = path.replace(config.root, "", 1) or "/" |
|---|
| 138 | 138 | old_url = urllib.quote(old_url) |
|---|
| 139 | 139 | html_parts.append( |
|---|
| r129 |
r130 |
|
| 201 | 201 | html = converter.text_to_html(text, path) |
|---|
| 202 | 202 | # assume title is UTF-8-encoded though we don't know for sure |
|---|
| 203 | | title = coding.decode(path).replace(config.root+os.sep, "") or u"." |
|---|
| | 203 | title = coding.decode(path).replace( |
|---|
| | 204 | config.root+os.sep, "",1) or u"." |
|---|
| 204 | 205 | self.emit_data(html, title=title, mtime=os.path.getmtime(path)) |
|---|
| 205 | 206 | |
|---|