You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ponymail.apache.org by "Humbedooh (via GitHub)" <gi...@apache.org> on 2023/06/13 17:39:24 UTC

[GitHub] [incubator-ponymail-foal] Humbedooh commented on pull request #243: Faster code to clean up quotes

Humbedooh commented on PR #243:
URL: https://github.com/apache/incubator-ponymail-foal/pull/243#issuecomment-1589751592

   Sorry for the long wait here!
   I've looked through the code, and I think - in order to actually achieve what we meant to do - we might wish to change it to:
   
   ~~~javascript
   quote = quote.replace(/\n>[>\s]*$/g, "\n");
   ~~~
   
   In layman's terms:
   - Find a newline that has a `>` (quote indicator) right after it (in other words, find a new line that begins with a `>`)
   - Check that only spaces and optional additional quote indicators succeed it, all the way to the end of the message
   - If found, replace with a single newline character.
   
   The difference in my example is the insistence on the first `>` encountered being at the beginning of a line, so as to not turn "<foo>" into "<foo" if it's on one of the last lines.
   
   FWIW, I did confirm that `\s` is perfectly capable of covering both spaces, tabs, newlines *and* carriage returns, which simplifies things.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@ponymail.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org