mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-07-23 10:27:51 +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:
@@ -7,6 +7,7 @@ import os
|
||||
import re
|
||||
|
||||
from . import utils
|
||||
import textwrap
|
||||
|
||||
# Disable line length warnings as wrapping the templates would be hard
|
||||
# flake8: noqa: E501
|
||||
@@ -22,8 +23,8 @@ class MdCodeGenerator:
|
||||
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