From c97cb3508687d05fb5e4241ef5ec7214f38f6fd9 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Wed, 8 Jul 2015 12:37:19 +0200 Subject: [PATCH] [FIX] doc: prevent compacting paragraphs with custom classes --- doc/_extensions/odoo/translator.py | 7 +++++++ 1 file changed, 7 insertions(+) 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

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