Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Commit

Permalink
Fixed mailto links. Bump to version v0.2.14
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Wentz committed Aug 11, 2014
1 parent c1effe5 commit 9c72e69
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "onion-editor",
"version": "0.2.13",
"version": "0.2.14",
"homepage": "https://github.com/theonion/editor",
"authors": [
"Mike Wnuk <mwnuk@theonion.com>"
Expand Down
2 changes: 1 addition & 1 deletion build/onion-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -10622,7 +10622,7 @@ define('link-formatter',[
if (
url.substr(0, 7) !== "http://" &&
url.substr(0, 8) !== "https://" &&
url.substr(0, 6) !== "mailto:" &&
url.substr(0, 7) !== "mailto:" &&
url.substr(0, 1) !== "/"
) {
// check for email, but default to http
Expand Down
4 changes: 2 additions & 2 deletions build/onion-editor.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "onion-editor",
"version": "0.2.12",
"version": "0.2.14",
"author": {
"name": "Mike Wnuk",
"email": "mwnuk@theonion.com"
Expand Down
2 changes: 1 addition & 1 deletion src/js/formatters/link-formatter.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ define([
if (
url.substr(0, 7) !== "http://" &&
url.substr(0, 8) !== "https://" &&
url.substr(0, 6) !== "mailto:" &&
url.substr(0, 7) !== "mailto:" &&
url.substr(0, 1) !== "/"
) {
// check for email, but default to http
Expand Down
6 changes: 6 additions & 0 deletions test/formatters/link-formatter-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ define(['scribe', 'formatters/link-formatter'], function(Scribe, LinkFormatter)
var body = '<p><a>Some heading or something</a></p>';
expect(scribe._htmlFormatterFactory.format(body)).toEqual(body);
});

it('handles mailto: links', function () {
scribe.use(new LinkFormatter({domain: 'example.com'}));
var body = '<p><a href="mailto:webtech@theonion.com">Send us an email</a></p>';
expect(scribe._htmlFormatterFactory.format(body)).toEqual(body);
});
});

});

0 comments on commit 9c72e69

Please sign in to comment.