~robin_jadoul/blog

32797858c9a18012131118d5837abb6ddfee4ed3 — Robin Jadoul 3 months ago c539f56 master
Hmm
1 files changed, 4 insertions(+), 3 deletions(-)

M ssg.py
M ssg.py => ssg.py +4 -3
@@ 229,9 229,10 @@ class YamlFrontmatterLoader(Loader):
            return f.read()
        f.seek(0)
        loader = yaml.SafeLoader(f)
        loader.get_event()
        loader.get_event()  # Skip stream and first document start, apparently no type stub available
        while not isinstance(e := loader.get_event(), yaml.DocumentStartEvent):
        loader.get_event()  # type: ignore[no-untyped-call]
        loader.get_event()  # type: ignore[no-untyped-call]  # Skip stream and first document start, apparently no type stub available
        while not isinstance(e := loader.get_event(),  # type: ignore[no-untyped-call]
                             yaml.DocumentStartEvent):
            pass
        f.seek(e.end_mark.index)
        return f.read().lstrip(b"\n")