diff --git a/mercurial/help.py b/mercurial/help.py --- a/mercurial/help.py +++ b/mercurial/help.py @@ -391,6 +391,12 @@ single documentation block and use it to overwrite the marker in doc. """ entries = [] + markerindent = 0 + markerpos = doc.find(marker) + if markerpos >= 0: + newlinepos = doc.rfind('\n', 0, markerpos) + if newlinepos >= 0: + markerindent = markerpos - newlinepos - 1 for name in sorted(items): text = (pycompat.getdoc(items[name]) or '').rstrip() if (not text @@ -407,7 +413,7 @@ if l.strip().startswith('>>>'): break if dedent: - doclines.append(l.rstrip()) + doclines.append(markerindent * ' ' + l.rstrip()) else: doclines.append(' ' + l.strip()) entries.append('\n'.join(doclines)) diff --git a/mercurial/help/hgweb.txt b/mercurial/help/hgweb.txt --- a/mercurial/help/hgweb.txt +++ b/mercurial/help/hgweb.txt @@ -83,4 +83,4 @@ The following web commands and their URLs are available: - .. webcommandsmarker +.. webcommandsmarker