mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
fix(docs): remove newlines interpreted as test
When documenting mandatory arguments of a methods builder, it was possible to document 'parts', which have a long multi-line description with empty lines inbetween. This caused the indentation to be funny and tricked rustdoc into thinking these are indented doc-tests. Now we remove these empty lines, also hoping we dont encounter lines with just whitespace in them. The latter would require a tiny update of our regex.
This commit is contained in:
@@ -150,6 +150,10 @@ def unindent_first_by(tabs):
|
||||
return re_linestart.sub(' ' * tabs * SPACES_PER_TAB, s)
|
||||
return unindent_inner
|
||||
|
||||
# filter to remove empty lines from a string
|
||||
def remove_empty_lines(s):
|
||||
return re.sub("^\n", '', s, flags=re.MULTILINE)
|
||||
|
||||
# Prepend prefix to each line but the first
|
||||
def prefix_all_but_first_with(prefix):
|
||||
def indent_inner(s):
|
||||
|
||||
Reference in New Issue
Block a user