N°4674 Fix code highlighter calls

This commit is contained in:
Stephen Abello
2022-02-02 10:35:50 +01:00
parent de053eed72
commit 7df27de5c1
6 changed files with 17 additions and 11 deletions

View File

@@ -161,7 +161,7 @@ body.ibo-has-fullscreen-descendant {
/* Preserve original text color in code blocks, except for the Highlight.js blocks which have their own colors */
& > code,
:not(pre.hljs) code {
code:not(.hljs) {
color: inherit;
}
}

View File

@@ -52,6 +52,10 @@ $ibo-vendors-ckeditor--autocomplete-item-title--text-color: #3A3A3A !default;
white-space: pre-line;
}
.ibo-hljs-container{
padding: 0 !important;
}
/* Mentions in caselogs */
/* Note: Mind the "ul", it allows us to have a more precise rule than the original plugin's CSS so we can override it */
ul.cke_autocomplete_panel{

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -141,25 +141,27 @@ const CombodoBackofficeToolbox = {
const sComplementarySelector = bForce ? '' : ':not(.hljs)';
// AttributeHTML and HTML AttributeText
let oCodeElements = oContainerElem.find('[data-attribute-type="AttributeHTML"], [data-attribute-type="AttributeText"], [data-attribute-type="AttributeTemplateHTML"]').find('.HTML pre'+sComplementarySelector+' > code');
let oCodeElements = oContainerElem.find('[data-attribute-type="AttributeHTML"], [data-attribute-type="AttributeText"], [data-attribute-type="AttributeTemplateHTML"]').find('.HTML pre > code'+sComplementarySelector);
if (oCodeElements.length > 0) {
if (typeof hljs === 'undefined') {
CombodoJSConsole.Error('Cannot format code snippets in HTML fields as the highlight.js lib is not loaded');
} else {
oCodeElements.parent().each(function (iIdx, oElem) {
oCodeElements.each(function (iIdx, oElem) {
hljs.highlightBlock(oElem);
$(oElem).parent().addClass('ibo-hljs-container');
});
}
}
// CaseLogs
oCodeElements = oContainerElem.find('[data-role="ibo-activity-entry--main-information-content"] pre'+sComplementarySelector+' > code');
oCodeElements = oContainerElem.find('[data-role="ibo-activity-entry--main-information-content"] pre > code'+sComplementarySelector);
if (oCodeElements.length > 0) {
if (typeof hljs === 'undefined') {
CombodoJSConsole.Error('Cannot format code snippets in log entries as the highlight.js lib is not loaded');
} else {
oCodeElements.parent().each(function (iIdx, oElem) {
oCodeElements.each(function (iIdx, oElem) {
hljs.highlightBlock(oElem);
$(oElem).parent().addClass('ibo-hljs-container');
});
}
}