Each bloc-comment is entered in the view list as a single multiline plus a final blank line. This is more complicated than needed and it's useless to first concatenate these lines to split them directly after. Also it makes harder to correctly track the line numbers. Fix this by adding the lines one by one, each with their own lineno. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- Documentation/sphinx/cdoc.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Documentation/sphinx/cdoc.py b/Documentation/sphinx/cdoc.py index 2718c86a8..dfb28a5bb 100755 --- a/Documentation/sphinx/cdoc.py +++ b/Documentation/sphinx/cdoc.py @@ -212,12 +212,11 @@ def convert_to_rst(info): lst.append((n, l)) if 'desc' in info: desc = info['desc'] - n = desc[0] - r = '' - for l in desc[1:]: - r += l + '\n' - lst.append((n, r)) - lst.append((n+1, '\n')) + n = desc[0] - 1 + desc.append('') + for i in range(1, len(desc)): + l = desc[i] + lst.append((n+i, l)) elif typ == 'func': (n, l) = info['func'] -- 2.18.0