diff options
| author | wiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2006-01-22 16:54:10 +0000 |
|---|---|---|
| committer | wiemann <wiemann@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2006-01-22 16:54:10 +0000 |
| commit | 9ebd6008d5748fbefa4ffe74576354907508ce74 (patch) | |
| tree | 8486319e15e932361550fc6cfd8f1765c67468f8 /docutils/writers | |
| parent | 75a6f005791e52d0c6317911bd70b0daeb59a1ff (diff) | |
| download | docutils-address-rendering.tar.gz | |
moved r4311 to address-rendering branchaddress-rendering
git-svn-id: http://svn.code.sf.net/p/docutils/code/branches/address-rendering@4314 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/writers')
| -rw-r--r-- | docutils/writers/html4css1/__init__.py | 12 | ||||
| -rw-r--r-- | docutils/writers/html4css1/html4css1.css | 6 | ||||
| -rw-r--r-- | docutils/writers/pep_html/pep.css | 6 |
3 files changed, 10 insertions, 14 deletions
diff --git a/docutils/writers/html4css1/__init__.py b/docutils/writers/html4css1/__init__.py index 02833d66a..50269f327 100644 --- a/docutils/writers/html4css1/__init__.py +++ b/docutils/writers/html4css1/__init__.py @@ -407,6 +407,16 @@ class HTMLTranslator(nodes.NodeVisitor): encoded = self.encode(text) if self.in_mailto and self.settings.cloak_email_addresses: encoded = self.cloak_email(encoded) + preserve_space = 0 + parent = node.parent + while parent: + if parent.get('xml:space') == 'preserve': + preserve_space = 1 + break + parent = parent.parent + if preserve_space: + encoded = encoded.replace('\n', '<br />') + encoded = encoded.replace(' ', ' ') self.body.append(encoded) def depart_Text(self, node): @@ -428,10 +438,8 @@ class HTMLTranslator(nodes.NodeVisitor): def visit_address(self, node): self.visit_docinfo_item(node, 'address', meta=None) - self.body.append(self.starttag(node, 'pre', CLASS='address')) def depart_address(self, node): - self.body.append('\n</pre>\n') self.depart_docinfo_item() def visit_admonition(self, node, name=''): diff --git a/docutils/writers/html4css1/html4css1.css b/docutils/writers/html4css1/html4css1.css index e94df1546..0af8fc34d 100644 --- a/docutils/writers/html4css1/html4css1.css +++ b/docutils/writers/html4css1/html4css1.css @@ -206,12 +206,6 @@ p.sidebar-subtitle { p.topic-title { font-weight: bold } -pre.address { - margin-bottom: 0 ; - margin-top: 0 ; - font-family: serif ; - font-size: 100% } - pre.literal-block, pre.doctest-block { margin-left: 2em ; margin-right: 2em ; diff --git a/docutils/writers/pep_html/pep.css b/docutils/writers/pep_html/pep.css index 014d3e423..b4f89eff1 100644 --- a/docutils/writers/pep_html/pep.css +++ b/docutils/writers/pep_html/pep.css @@ -269,12 +269,6 @@ p.topic-title { font-family: sans-serif ; font-weight: bold } -pre.address { - margin-bottom: 0 ; - margin-top: 0 ; - font-family: serif ; - font-size: 100% } - pre.literal-block, pre.doctest-block { margin-left: 2em ; margin-right: 2em ; |
