diff --git a/packages/ketcher-core/src/application/render/renderStruct.ts b/packages/ketcher-core/src/application/render/renderStruct.ts index 67288a6544..401b5f03b5 100644 --- a/packages/ketcher-core/src/application/render/renderStruct.ts +++ b/packages/ketcher-core/src/application/render/renderStruct.ts @@ -74,11 +74,7 @@ export class RenderStruct { return; } - console.log('-----START-------'); - console.log(struct.sgroups); const preparedStruct = this.prepareStruct(struct); - console.log(preparedStruct.sgroups); - console.log('-----END-------'); preparedStruct.initHalfBonds(); preparedStruct.initNeighbors(); preparedStruct.setImplicitHydrogen(); diff --git a/packages/ketcher-core/src/application/render/restruct/retext.ts b/packages/ketcher-core/src/application/render/restruct/retext.ts index a54b71ff72..e043a17255 100644 --- a/packages/ketcher-core/src/application/render/restruct/retext.ts +++ b/packages/ketcher-core/src/application/render/restruct/retext.ts @@ -238,6 +238,11 @@ class ReText extends ReObject { null, ); + // Sort to apply font size styles first and then override it by subscript/superscript styles + ranges.sort((_, nextRange) => { + return nextRange.style.includes(TextCommand.FontSize) ? 1 : -1; + }); + return ranges.reduce( (styles: any, textRange: CustomRawDraftInlineStyleRange) => { const fontsz = customFontSize || options.fontsz;