mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-09-22 08:16:09 +08:00
fix(mailto): Correct mailto handling when link has &
instead of first ?
This commit is contained in:
parent
728d99e5e0
commit
48ed1a98f1
|
@ -852,6 +852,7 @@ describe "DraftStore", ->
|
|||
'mailto:?subject=%52z2a', # passes uriDecode
|
||||
'mailto:?subject=Martha Stewart',
|
||||
'mailto:?subject=Martha Stewart&cc=cc@nylas.com',
|
||||
'mailto:bengotow@gmail.com&subject=Martha Stewart&cc=cc@nylas.com',
|
||||
'mailto:bengotow@gmail.com?subject=Martha%20Stewart&cc=cc@nylas.com&bcc=bcc@nylas.com',
|
||||
'mailto:bengotow@gmail.com?subject=Martha%20Stewart&cc=cc@nylas.com&bcc=Ben <bcc@nylas.com>',
|
||||
'mailto:Ben Gotow <bengotow@gmail.com>,Shawn <shawn@nylas.com>?subject=Yes this is really valid'
|
||||
|
@ -879,6 +880,11 @@ describe "DraftStore", ->
|
|||
cc: [new Contact(name: 'cc@nylas.com', email: 'cc@nylas.com')],
|
||||
subject: 'Martha Stewart'
|
||||
),
|
||||
new Message(
|
||||
to: [new Contact(name: 'bengotow@gmail.com', email: 'bengotow@gmail.com')],
|
||||
cc: [new Contact(name: 'cc@nylas.com', email: 'cc@nylas.com')],
|
||||
subject: 'Martha Stewart'
|
||||
),
|
||||
new Message(
|
||||
to: [new Contact(name: 'bengotow@gmail.com', email: 'bengotow@gmail.com')],
|
||||
cc: [new Contact(name: 'cc@nylas.com', email: 'cc@nylas.com')],
|
||||
|
|
|
@ -418,7 +418,7 @@ class DraftStore
|
|||
try
|
||||
urlString = decodeURI(urlString)
|
||||
|
||||
[whole, to, query] = /mailto:[//]?([^\?]*)[\?]?(.*)/.exec(urlString)
|
||||
[whole, to, query] = /mailto:[//]?([^\?\&]*)[\?\&]?(.*)/.exec(urlString)
|
||||
|
||||
query = require('querystring').parse(query)
|
||||
query.to = to
|
||||
|
|
Loading…
Reference in a new issue