mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-22 08:58:54 +02:00
gdbus-codegen: preserve relative indentation in doc comments
This commit also changes the generators for rst, xml and dockbook to preserve indentation. Closes #3032
This commit is contained in:
@@ -6,6 +6,7 @@ import os
|
||||
import re
|
||||
|
||||
from . import utils
|
||||
import textwrap
|
||||
|
||||
# Disable line length warnings as wrapping the templates would be hard
|
||||
# flake8: noqa: E501
|
||||
@@ -21,8 +22,8 @@ class RstCodeGenerator:
|
||||
def _expand(self, s, expandParamsAndConstants):
|
||||
"""Expands parameters and constant literals."""
|
||||
res = []
|
||||
for line in s.split("\n"):
|
||||
line = line.strip()
|
||||
for line in textwrap.dedent(s).split("\n"):
|
||||
line = line.rstrip()
|
||||
if line == "":
|
||||
res.append("")
|
||||
continue
|
||||
|
Reference in New Issue
Block a user