Commit d90555ef authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

docs: parser_yaml.py: fix backward compatibility with old docutils



As reported by Akira, older docutils versions are not compatible
with the way some Sphinx versions send tab_width. Add a code to
address it.

Reported-by: default avatarAkira Yokosawa <akiyks@gmail.com>
Closes: https://lore.kernel.org/linux-doc/598b2cb7-2fd7-4388-96ba-2ddf0ab55d2a@gmail.com/


Tested-by: default avatarAkira Yokosawa <akiyks@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 0b24dfdd
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -77,6 +77,10 @@ class YamlParser(Parser):

                result.append(line, document.current_source, lineoffset)

            # Fix backward compatibility with docutils < 0.17.1
            if "tab_width" not in vars(document.settings):
                document.settings.tab_width = 8

            rst_parser = RSTParser()
            rst_parser.parse('\n'.join(result), document)