Mailspring/src/regexp-utils.coffee
Ben Gotow 4be05ff754 feat(tracking-pixels): New MessageStore extension cuts out tracking pixels you've *sent* so you don't trigger them
Summary:
- Remove thread_participants prop, we don't use them anywhere and the underscore-case is ugly.

- Move autolinker into extension, update autolinker to 0.18.1 for phone number support

- document message.coffee, add isFromMe()

- Add tracking pixel extension that removes pixels from mail you *send*. Maybe more features later.

Test Plan: Run 1 new test! (woo...)

Reviewers: evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D1787
2015-07-23 10:57:13 -07:00

16 lines
563 B
CoffeeScript

RegExpUtils =
# It's important that the regex be wrapped in parens, otherwise
# javascript's RegExp::exec method won't find anything even when the
# regex matches!
#
# It's also imporant we return a fresh copy of the RegExp every time. A
# javascript regex is stateful and multiple functions using this method
# will cause unexpected behavior!
emailRegex: -> new RegExp(/([a-z.A-Z0-9%+_-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4})/g)
# https://regex101.com/r/zG7aW4/3
imageTagRegex: -> /<img\s+[^>]*src="([^"]*)"[^>]*>/g
module.exports = RegExpUtils