void () { String text = "b&nbsp;".repeat(10_000); String expected = "b ".repeat(10_000).trim(); PsiFile file = myFixture.configureByText("a.md", text); var psi = PsiTreeUtil.findElementOfClassAtOffset(file, 10, MarkdownParagraph.class, false); TextExtractor extractor = new MarkdownTextExtractor(); PlatformTestUtil.startPerformanceTest("TextContent building with nbsp removal", 200, () -> { assertEquals(expected, extractor.buildTextContent(psi, TextContent.TextDomain.ALL).toString()); }).assertTiming(); }