Fixed sizing for codeblocks

This commit is contained in:
mpetrov 2024-10-31 16:52:40 +02:00
parent 9ec8617433
commit c5e7b5f93d
3 changed files with 4 additions and 4 deletions

View File

@ -139,14 +139,14 @@ export class EventContentDialogComponent extends DialogComponent<EventContentDia
let newWidth = 600;
if (content && content.length > 0) {
const lines = content.split('\n');
newHeight = 16 * lines.length + 16;
newHeight = 18 * lines.length + 16;
let maxLineLength = 0;
lines.forEach((row) => {
const line = row.replace(/\t/g, ' ').replace(/\n/g, '');
const lineLength = line.length;
maxLineLength = Math.max(maxLineLength, lineLength);
});
newWidth = 8 * maxLineLength + 16;
newWidth = 10 * maxLineLength + 16;
}
// newHeight = Math.min(400, newHeight);
this.renderer.setStyle(editorElement, 'minHeight', newHeight.toString() + 'px');

View File

@ -118,7 +118,7 @@
padding: 0;
pre[class*=language-] {
margin: 0;
padding: 9px 38px 9px 16px;
padding: 10px 38px 10px 16px;
background: rgba(0, 0, 0, 0.03);
border-radius: 6px;
border: none;

View File

@ -370,7 +370,7 @@
}
&.line-numbers {
padding-left: 66px;
padding: 10px 16px 10px 66px;
& > code {
span.line-numbers-rows {