From d9cdcfa3326425d80a4cb998e9935c1f5b06a71c Mon Sep 17 00:00:00 2001 From: yuri Date: Fri, 13 Sep 2019 15:38:23 +0300 Subject: [PATCH] markdown in tooltips --- client/src/views/fields/base.js | 5 +++-- frontend/less/espo/custom.less | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/client/src/views/fields/base.js b/client/src/views/fields/base.js index b9b78f08e1..3253dba4ed 100644 --- a/client/src/views/fields/base.js +++ b/client/src/views/fields/base.js @@ -380,13 +380,14 @@ Espo.define('views/fields/base', 'view', function (Dep) { tooltipText = this.translate(this.tooltip, 'tooltips', this.model.name); } - tooltipText = tooltipText || this.translate(this.name, 'tooltips', this.model.name); + tooltipText = tooltipText || this.translate(this.name, 'tooltips', this.model.name) || ''; + tooltipText = this.getHelper().transfromMarkdownText(tooltipText).toString(); $a.popover({ placement: 'bottom', container: 'body', html: true, - content: tooltipText.replace(/\n/g, "
"), + content: tooltipText, }).on('shown.bs.popover', function () { $('body').off('click.popover-' + this.id); $('body').on('click.popover-' + this.id , function (e) { diff --git a/frontend/less/espo/custom.less b/frontend/less/espo/custom.less index 9544d43b4f..4bc310ff76 100644 --- a/frontend/less/espo/custom.less +++ b/frontend/less/espo/custom.less @@ -2463,7 +2463,8 @@ table.table td.cell .complex-text { white-space: normal; } -.complex-text { +.complex-text, +.popover-content { h1:first-child, h2:first-child, h3:first-child,