StringBuilder ( @NotNull StringBuilder buffer, @NotNull Project project, @NotNull Language language, @Nullable String codeSnippet, boolean doTrimIndent, float saturationFactor ) { codeSnippet = StringUtil.notNullize(codeSnippet); String trimmed = doTrimIndent ? StringsKt.trimIndent(codeSnippet) : codeSnippet; String zeroIndentCode = trimmed.replace("\t", " "); if (!zeroIndentCode.isEmpty()) { PsiFile fakePsiFile = PsiFileFactory.getInstance(project).createFileFromText(language, codeSnippet); EditorColorsScheme scheme = new ColorsSchemeWithChangedSaturation(EditorColorsManager.getInstance().getGlobalScheme(), saturationFactor); buffer.append(getHtmlContent(fakePsiFile, zeroIndentCode, null, scheme, 0, zeroIndentCode.length())); } return buffer; }