16

I just recently submitted an answer written in the new editor that contained an email:

xxx@yyy.com

After I posted it, I clicked 'edit', switched to rich text mode, made some changes and submitted my edits. However, the email became a link:

mailto:xxx@yyy.com

For some reason, I suspect this is a bug...

When I write in CommonMark mode, this doesn't happen.

Note that I can't even remove mailto in the new editor... I can only remove it by switching back to CommonMark mode.

10
  • 13
    Even if it is not a bug but somehow "by design" that feature should be disabled. Do not linkify emails, ever.
    – rene
    Sep 25 at 7:11
  • 2
    The Stacks editor uses the markdown-it library to parse CommonMark, apparently with the linkify option set to true (default is false). This option uses the linkify-it library (ref) that converts emails to links by default (ref). Sep 25 at 13:01
  • 3
    Lines 274-278 in markdown-parser.test.ts indicate that developers are indeed aware of this particular auto-linking behaviour. Sep 25 at 13:05
  • 1
    @double-beep there are a few issues with the implementation though. Even though it renders as a link in wysiwyg mode, when you save, it is not linked anymore. Also, more strangely, if you surround the email address with double quotes, the email address isn't linked AND mailto: is included as literal text. Sep 25 at 17:30
  • @double-beep here is the revision that I made on one of U12-Forward's post that led to this bug report: meta.stackexchange.com/revisions/370234/2. Notice that "team@stackoverflow.com" got changed to "mailto:team@stackoverflow.com" Sep 25 at 17:32
  • As far as I know, bug reports for the "new" editor are still being collected as answers on the question: "Opt-in alpha test for a new Stacks editor", rather than as separate bug report questions. This question should be deleted and the bug report reposted as an answer on the announcement question.
    – Makyen
    Sep 25 at 17:43
  • @rene Yeah! I agree! Sep 26 at 1:51
  • @double-beep Ah Sep 26 at 1:51
  • I guess give this 6-8 weeks to solve :) Sep 26 at 5:18
  • I opened a PR that addresses this question. We now only have to wait 6-8 weeks for the devs to merge it. Sep 27 at 18:34

You must log in to answer this question.

Browse other questions tagged .