raw string \f

This commit is contained in:
ShreySinha02 2024-02-15 16:04:27 +05:30
parent 9f4db6d6d3
commit 62d6b86c34
1 changed files with 2 additions and 0 deletions

View File

@ -1,4 +1,5 @@
import asyncio
import codecs
import dataclasses
import email.message
import inspect
@ -502,6 +503,7 @@ class APIRoute(routing.Route):
self.secure_cloned_response_field = None
self.dependencies = list(dependencies or [])
self.description = description or inspect.cleandoc(self.endpoint.__doc__ or "")
self.description = codecs.decode(self.description, "unicode_escape")
# if a "form feed" character (page break) is found in the description text,
# truncate description text to the content preceding the first "form feed"
self.description = self.description.split("\f")[0].strip()