Skip to content

Commit

Permalink
New version 3.2.7. Read more https://github.com/xdan/jodit/releases/t…
Browse files Browse the repository at this point in the history
  • Loading branch information
xdan committed Jul 13, 2018
1 parent a6e72ff commit 38d3dd1
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 8 deletions.
4 changes: 2 additions & 2 deletions build/jodit.min.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions build/jodit.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jodit",
"version": "3.2.6",
"version": "3.2.7",
"description": "Jodit is awesome and usefully wysiwyg editor with filebrowser",
"main": "build/jodit.min.js",
"scripts": {
Expand Down
11 changes: 11 additions & 0 deletions src/modules/Selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,18 @@ export class Select extends Component{
if (!this.isCollapsed()) {
const selInfo: markerInfo[] = this.save();
normalizeNode(this.jodit.editor.firstChild); // FF fix for test "commandsTest - Exec command "bold" for some text that contains a few STRONG elements, should unwrap all of these"

// fix issue https://github.com/xdan/jodit/issues/65
$$('*[style*=font-size]', this.jodit.editor).forEach((elm: HTMLElement) => {
elm.style && elm.style.fontSize && elm.setAttribute('data-font-size', elm.style.fontSize.toString());
});
this.jodit.editorDocument.execCommand('fontsize', false, 7);
$$('*[data-font-size]', this.jodit.editor).forEach((elm: HTMLElement) => {
if (elm.style && elm.getAttribute('data-font-size')) {
elm.style.fontSize = elm.getAttribute('data-font-size');
elm.removeAttribute('data-font-size');
}
});

$$('font[size="7"]', this.jodit.editor).forEach((font: HTMLElement) => {
if (!Dom.next(font, findNextCondition, <HTMLElement>font.parentNode) && !Dom.prev(font, findNextCondition, <HTMLElement>font.parentNode) && isSuitElement(<HTMLElement>font.parentNode) && font.parentNode !== this.jodit.editor && (!Dom.isBlock(font.parentNode) || consts.IS_BLOCK.test(nodeName))) {
Expand Down
5 changes: 3 additions & 2 deletions test/tests/commandsTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -430,14 +430,15 @@ describe('Commands Jodit Editor Tests', function() {
var sel = editor.editorWindow.getSelection(),
range = editor.editorDocument.createRange();

range.selectNodeContents(editor.editor.firstChild);
range.setStart(editor.editor.firstChild.firstChild, 0);
range.setEnd(editor.editor.firstChild.firstChild, 6);

sel.removeAllRanges();
sel.addRange(range);

editor.execCommand('bold');

expect(editor.getEditorValue()).to.equal('<span style="font-size: 36px;"><strong>asdasd</strong></span>');
expect(sortAtrtibutes(editor.value)).to.equal(sortAtrtibutes('<span style="font-size: 36px;"><strong>asdasd</strong></span>'));

});
});
Expand Down

0 comments on commit 38d3dd1

Please sign in to comment.