mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-18 14:58:43 +02:00
N°4674 Fix code highlighter calls
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
4
css/backoffice/vendors/_ckeditor.scss
vendored
4
css/backoffice/vendors/_ckeditor.scss
vendored
@@ -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
@@ -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');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user