Skip to content

Commit

Permalink
typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Morgan Croney committed Sep 20, 2016
1 parent 4a25f6a commit 5b8405f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions spec/anchor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ describe('Anchor Button TestCase', function () {
expect(link.getAttribute('href')).toBe(validHashLink);
});

it('should change spaces to %20 for a valid url if linkValidation options is set to true', function () {
it('should change spaces to %20 for a valid url if linkValidation option is set to true', function () {
var editor = this.newMediumEditor('.editor', {
anchor: {
linkValidation: true
Expand All @@ -382,7 +382,7 @@ describe('Anchor Button TestCase', function () {
expect(link.href).toBe(expectedOpts.value);
});

it('should not encode an encoded URL if linkValidation options is set to true', function () {
it('should not encode an encoded URL if linkValidation option is set to true', function () {
var editor = this.newMediumEditor('.editor', {
anchor: {
linkValidation: true
Expand All @@ -396,7 +396,6 @@ describe('Anchor Button TestCase', function () {
};

spyOn(editor, 'execAction').and.callThrough();

selectElementContentsAndFire(editor.elements[0]);
anchorExtension.showForm('a%20b.com/');
fireEvent(anchorExtension.getForm().querySelector('a.medium-editor-toolbar-save'), 'click');
Expand All @@ -408,7 +407,7 @@ describe('Anchor Button TestCase', function () {
expect(link.href).toBe(expectedOpts.value);
});

it('should encode query params if linkValidation options is set to true', function () {
it('should encode query params if linkValidation option is set to true', function () {
var editor = this.newMediumEditor('.editor', {
anchor: {
linkValidation: true
Expand All @@ -434,7 +433,7 @@ describe('Anchor Button TestCase', function () {
expect(link.href).toBe(expectedOpts.value);
});

it('should not encode an encoded query param if linkValidation options is set to true', function () {
it('should not encode an encoded query param if linkValidation option is set to true', function () {
var editor = this.newMediumEditor('.editor', {
anchor: {
linkValidation: true
Expand Down
2 changes: 1 addition & 1 deletion src/js/extensions/anchor.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
// Matches common external protocols "mailto:" "tel:" "maps:"
// Matches relative hash link, begins with "#"
var urlSchemeRegex = /^([a-z]+:)?\/\/|^(mailto|tel|maps):|^\#/i,
// var te is a regex for checking if the string is a telephone number
// telRegex is a regex for checking if the string is a telephone number
telRegex = /^\+?\s?\(?(?:\d\s?\-?\)?){3,20}$/,
split = value.split('?'),
path = split[0],
Expand Down

0 comments on commit 5b8405f

Please sign in to comment.