-
Notifications
You must be signed in to change notification settings - Fork 264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix markdown block quote truncation #1457
Conversation
8a3d4a5
to
2331dcf
Compare
74d5c93
to
426f3f0
Compare
@@ -71,6 +71,8 @@ botocore = "1.31.72" | |||
boto3 = "1.28.72" | |||
requests = "^2.32.3" | |||
certifi = "^2023.7.22" | |||
regex = "2024.5.15" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This because stdlib re
does not support reverse search (regex.REVERSE
) up to Python 3.12
@@ -71,6 +71,8 @@ botocore = "1.31.72" | |||
boto3 = "1.28.72" | |||
requests = "^2.32.3" | |||
certifi = "^2023.7.22" | |||
regex = "2024.5.15" | |||
more_itertools = { version = "^10.3", python = "<3.12" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This because batched
appeared in stdlib itertools
only in Python 3.12
ffb30c6
to
8eb1169
Compare
8eb1169
to
c721262
Compare
@@ -58,6 +58,10 @@ def apply_length_limit(msg: str, max_length: int, truncator: Optional[str] = Non | |||
truncator = truncator or "..." | |||
return msg[: max_length - len(truncator)] + truncator | |||
|
|||
@staticmethod | |||
def apply_length_limit_to_markdown(msg: str, max_length: int, truncator: str = "...") -> str: | |||
return trim_markdown(msg, max_length, truncator) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would put this in a try catch and if this thows an exception try to run apply_length_limit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM one comment
No description provided.