diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2018-11-09 09:34:31 +0000 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2018-11-09 10:45:17 +0000 |
| commit | 726bc301cff3f5a2ef0b07940e3fa48bf9ed4330 (patch) | |
| tree | 06de2b8f523e00d3e6ecda48e26951d23364f0b9 /addons/web_editor | |
| parent | 055e1b8324b09261d3e19fb31bfdd9b84db78b42 (diff) | |
[FIX] web_editor: don't prepend http to ${..} link
In mail template a link with reference such as:
${object.user_id.signup_url}
are often used.
These are template directives that are replaced when the mail is saved,
so when editing in the editor and they are prefixed by "http://" this
breaks the link which is not wanted.
Now link beginning with `${` are not prefixed anymore to prevent
shooting oneself in the foot.
opw-1906695
closes #28522
Diffstat (limited to 'addons/web_editor')
| -rw-r--r-- | addons/web_editor/static/src/js/editor/summernote.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/editor/summernote.js b/addons/web_editor/static/src/js/editor/summernote.js index 91a230a9518..36729ff8ed3 100644 --- a/addons/web_editor/static/src/js/editor/summernote.js +++ b/addons/web_editor/static/src/js/editor/summernote.js @@ -2286,7 +2286,8 @@ options.onCreateLink = function (sLinkUrl) { // pass } else if (sLinkUrl.indexOf('@') !== -1 && sLinkUrl.indexOf(':') === -1) { sLinkUrl = 'mailto:' + sLinkUrl; - } else if (sLinkUrl.indexOf('://') === -1 && sLinkUrl.indexOf('/') !== 0 && sLinkUrl.indexOf('#') !== 0) { + } else if (sLinkUrl.indexOf('://') === -1 && sLinkUrl[0] !== '/' + && sLinkUrl[0] !== '#' && sLinkUrl.slice(0, 2) !== '${') { sLinkUrl = 'http://' + sLinkUrl; } return sLinkUrl; |
