diff options
| author | Xavier Morel <xmo@odoo.com> | 2015-07-08 12:37:19 +0200 |
|---|---|---|
| committer | Xavier Morel <xmo@odoo.com> | 2015-07-08 13:06:11 +0200 |
| commit | c97cb3508687d05fb5e4241ef5ec7214f38f6fd9 (patch) | |
| tree | 107b5ddb55f8b90c67f1f87354046c49d6232be7 /doc/_extensions | |
| parent | 9beaeddf606d0daac589561474a3799bb66f72c1 (diff) | |
[FIX] doc: prevent compacting paragraphs with custom classes
Diffstat (limited to 'doc/_extensions')
| -rw-r--r-- | doc/_extensions/odoo/translator.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/_extensions/odoo/translator.py b/doc/_extensions/odoo/translator.py index 6bb041e2323..9e0762ed208 100644 --- a/doc/_extensions/odoo/translator.py +++ b/doc/_extensions/odoo/translator.py @@ -144,6 +144,13 @@ class BootstrapTranslator(nodes.NodeVisitor, object): addnodes.versionmodified)): # Never compact paragraphs in document or compound. return False + + for key, value in node.attlist(): + # we can ignore a few specific classes, all other non-default + # attributes require that a <p> node remains + if key != 'classes' or value not in ([], ['first'], ['last'], ['first', 'last']): + return False + first = isinstance(node.parent[0], nodes.label) for child in parent.children[first:]: # only first paragraph can be compact |
