Skip to content

Commit

Permalink
FIX Cannot link an image in TinyMCE
Browse files Browse the repository at this point in the history
  • Loading branch information
Sabina Talipova committed Sep 5, 2023
1 parent 714c773 commit 94b84cf
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion client/dist/js/TinyMCE_sslink-email.js

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

2 changes: 1 addition & 1 deletion client/dist/js/TinyMCE_sslink-external.js

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

2 changes: 1 addition & 1 deletion client/dist/js/bundle.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion client/src/legacy/TinyMCE_sslink-email.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ jQuery.entwine('ss', ($) => {
const handleInsert = (...args) => this.handleInsert(...args);
const attrs = this.getOriginalAttributes();
const selection = tinymce.activeEditor.selection;
const selectionContent = selection.getContent() || '';
let selectionContent = selection.getContent() || '';
if (!selectionContent) {
selectionContent = selection.getSel().toString();
}
selectionContent = selectionContent || '';
const tagName = selection.getNode().tagName;
const requireLinkText = tagName !== 'A' && selectionContent.trim() === '';

Expand Down
6 changes: 5 additions & 1 deletion client/src/legacy/TinyMCE_sslink-external.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ jQuery.entwine('ss', ($) => {
const handleInsert = (...args) => this.handleInsert(...args);
const attrs = this.getOriginalAttributes();
const selection = tinymce.activeEditor.selection;
const selectionContent = selection.getContent() || '';
let selectionContent = selection.getContent() || '';
if (!selectionContent) {
selectionContent = selection.getSel().toString();
}
selectionContent = selectionContent || '';
const tagName = selection.getNode().tagName;
const requireLinkText = tagName !== 'A' && selectionContent.trim() === '';

Expand Down

0 comments on commit 94b84cf

Please sign in to comment.