You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're using a pretty standard setup of Discourse with email integration, and it looks like even within code blocks the trimming rules are applied. So for example in an email containing:
# This should not be deleted
#
# Or trimmed
# It is code
####
Code code code
Everything below the first '#' is trimmed. That's a bit inconvenient, as many folks use comment markers to break sections of their code, sometimes even in multi-line strings for printing. Is there any chance this is a common enough issue that someone might have a moment to see if it could be improved? I've gotten as far as the regex where the matching happens, but I'm not sure how complex adding an exception for code blocks would be.
Thanks,
Zach
The text was updated successfully, but these errors were encountered:
zlmarshall
pushed a commit
to zlmarshall/email_reply_trimmer
that referenced
this issue
Nov 16, 2024
Addresses discourse#21
Adds two new regex classes identifying opening and closing code blocks
based on discourse rules for code blocks.
Creates two new patterns for matching either of those code block
patterns, and an additional pattern for matching both (since something
like "```" will match both opening and closing block patterns).
Allows delimiters within code blocks.
We're using a pretty standard setup of Discourse with email integration, and it looks like even within code blocks the trimming rules are applied. So for example in an email containing:
Everything below the first '#' is trimmed. That's a bit inconvenient, as many folks use comment markers to break sections of their code, sometimes even in multi-line strings for printing. Is there any chance this is a common enough issue that someone might have a moment to see if it could be improved? I've gotten as far as the regex where the matching happens, but I'm not sure how complex adding an exception for code blocks would be.
Thanks,
Zach
The text was updated successfully, but these errors were encountered: