Skip to content

Commit

Permalink
Merge pull request #1550 from arteconceito/updates-and-fixes
Browse files Browse the repository at this point in the history
Dependency updates, minor fixes and resolve CI issues (build failing)
  • Loading branch information
ksorv authored Jul 14, 2020
2 parents 6522435 + 8735408 commit f6ec06b
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 37 deletions.
47 changes: 24 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,36 +39,37 @@
},
"license": "MIT",
"devDependencies": {
"brfs": "1.4.2",
"connect": "3.5.0",
"grunt": "0.4.5",
"grunt-autoprefixer": "3.0.3",
"grunt-bump": "0.7.0",
"grunt-cli": "1.2.0",
"grunt-contrib-concat": "0.5.1",
"grunt-contrib-connect": "0.11.2",
"grunt-contrib-csslint": "0.5.0",
"grunt-contrib-cssmin": "0.14.0",
"brfs": "2.0.2",
"connect": "3.7.0",
"grunt": "1.2.1",
"grunt-autoprefixer": "3.0.4",
"grunt-bump": "0.8.0",
"grunt-cli": "1.3.2",
"grunt-contrib-concat": "1.0.1",
"grunt-contrib-connect": "2.1.0",
"grunt-contrib-csslint": "2.0.0",
"grunt-contrib-cssmin": "3.0.0",
"grunt-contrib-jasmine": "1.0.3",
"grunt-contrib-jshint": "0.11.3",
"grunt-contrib-uglify": "0.11.0",
"grunt-contrib-watch": "0.6.1",
"grunt-coveralls": "1.0.0",
"grunt-jscs": "2.6.0",
"grunt-plato": "1.3.0",
"grunt-sass": "1.2.1",
"grunt-saucelabs": "8.6.2",
"grunt-contrib-jshint": "2.1.0",
"grunt-contrib-uglify": "4.0.1",
"grunt-contrib-watch": "1.1.0",
"grunt-coveralls": "2.0.0",
"grunt-jscs": "3.0.1",
"grunt-plato": "1.4.0",
"grunt-sass": "3.1.0",
"grunt-saucelabs": "9.0.1",
"grunt-template-jasmine-istanbul": "0.4.0",
"jshint-stylish": "2.1.0",
"load-grunt-tasks": "3.4.0",
"jshint-stylish": "2.2.1",
"load-grunt-tasks": "5.1.0",
"lodash": "3.10.1",
"serve-static": "1.11.2",
"time-grunt": "1.3.0"
"open-cli": "6.0.1",
"serve-static": "1.14.1",
"time-grunt": "2.0.0"
},
"scripts": {
"test": "node node_modules/grunt-cli/bin/grunt test --verbose",
"test:ci": "node node_modules/grunt-cli/bin/grunt travis --verbose",
"start": "open ./demo/index.html",
"start": "open-cli ./demo/index.html",
"build": "node node_modules/grunt-cli/bin/grunt"
}
}
16 changes: 12 additions & 4 deletions spec/core-api.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,18 @@ describe('Core-API', function () {
}
}),
toolbar = editor.getExtensionByName('toolbar'),
button;
button,
// Beacuse not all browsers use <strike> or <s>, check for both
sTagO = '<(s|strike)>',
sTagC = '</(s|strike)>',
// Edge breaks this into 3 separate <u> tags for some reason...
regex = new RegExp([
'^<u>lorem ',
'(<i>' + sTagO + '|' + sTagO + '<i>|</u><i><u>' + sTagO + ')',
'ipsum',
'(</i>' + sTagC + '|' + sTagC + '</i>|' + sTagC + '</u></i><u>)',
' dolor</u>$'
].join(''));

// Save selection around <i> tag
selectElementContents(editor.elements[0].querySelector('i'));
Expand All @@ -153,9 +164,6 @@ describe('Core-API', function () {
editor.restoreSelection();
button = toolbar.getToolbarElement().querySelector('[data-action="strikethrough"]');
fireEvent(button, 'click');

// Edge breaks this into 3 separate <u> tags for some reason...
var regex = new RegExp('^<u>lorem (<i><s>|<s><i>|</u><i><u><s>)ipsum(</i></s>|</s></i>|</s></u></i><u>) dolor</u>$');
expect(editor.elements[0].innerHTML).toMatch(regex);
});
});
Expand Down
10 changes: 8 additions & 2 deletions spec/full-content.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ describe('Full Content Action TestCase', function () {
describe('Selection', function () {
it('should preserve selection after multiple full-content commands', function () {
this.el.innerHTML = '<p>lorem <u>ipsum</u> dolor</p>';
var editor = this.newMediumEditor('.editor');

var editor = this.newMediumEditor('.editor'),
// Beacuse not all browsers use <strike> or <s>, check for both
sTagO = '<(s|strike)>',
sTagC = '</(s|strike)>',
regex = new RegExp('^<p><u>lorem ' + sTagO + 'ipsum' + sTagC + ' dolor</u></p>$');

selectElementContentsAndFire(editor.elements[0].querySelector('u'));

editor.execAction('full-underline');
Expand All @@ -44,7 +50,7 @@ describe('Full Content Action TestCase', function () {

// Ensure the selection is still maintained
editor.execAction('strikethrough');
expect(this.el.innerHTML).toBe('<p><u>lorem <s>ipsum</s> dolor</u></p>');
expect(this.el.innerHTML).toMatch(regex);
});

it('should justify all contents including multiple block elements', function () {
Expand Down
10 changes: 5 additions & 5 deletions spec/toolbar.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -735,11 +735,11 @@ describe('MediumEditor.extensions.toolbar TestCase', function () {
window.document.body.appendChild(relativeContainer);

var editor = this.newMediumEditor('.editor', {
toolbar: {
relativeContainer: document.getElementById('someRelativeDiv')
}
}),
toolbarHTML = editor.getExtensionByName('toolbar').getToolbarElement().outerHTML;
toolbar: {
relativeContainer: document.getElementById('someRelativeDiv')
}
}),
toolbarHTML = editor.getExtensionByName('toolbar').getToolbarElement().outerHTML;

expect(document.getElementById('someRelativeDiv').innerHTML).toBe(toolbarHTML);
});
Expand Down
4 changes: 2 additions & 2 deletions src/js/core.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
(function () {
'use strict';

var initialContent = {};

// Event handlers that shouldn't be exposed externally

function handleDisableExtraSpaces(event) {
Expand Down Expand Up @@ -684,8 +686,6 @@
}
}

var initialContent = {};

MediumEditor.prototype = {
// NOT DOCUMENTED - exposed for backwards compatability
init: function (elements, options) {
Expand Down
2 changes: 1 addition & 1 deletion src/js/extensions/paste.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
};

/*jslint regexp: true*/
/*
/**
jslint does not allow character negation, because the negation
will not match any unicode characters. In the regexes in this
block, negation is used specifically to match the end of an html
Expand Down

0 comments on commit f6ec06b

Please sign in to comment.