Skip to content
This repository was archived by the owner on Jan 19, 2025. It is now read-only.

Commit 41cb0f4

Browse files
MasaraAclrianlars-reimann
authored
feat(gui): format code blocks in documentation (#933)
* feat: Fixed duplicated colon and code formation in code documentation text * feat: Added a user icon for annotations which where added by the current user. * Revert "feat: Added a user icon for annotations which where added by the current user." This reverts commit ba4e6ec. * style: update comment Co-authored-by: Aclrian <[email protected]> Co-authored-by: Lars Reimann <[email protected]>
1 parent 00e6718 commit 41cb0f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

api-editor/gui/src/features/packageData/selectionView/DocumentationText.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,12 @@ export const DocumentationText: React.FC<DocumentationTextProps> = function ({ d
8080
const expandDocumentationByDefault = useAppSelector(selectExpandDocumentationByDefault);
8181

8282
const preprocessedText = inputText
83-
// replace single new-lines by spaces
84-
.replaceAll(/(?<!\n)\n(?!\n)/gu, ' ')
8583
// replace inline math elements
8684
.replaceAll(/:math:`([^`]*)`/gu, '$$1$')
8785
// replace block math elements
8886
.replaceAll(/\.\. math::\s*(\S.*)\n\n/gu, '$$\n$1\n$$\n\n')
87+
// replace double colons with single colon
88+
.replaceAll(/::/gu, ':')
8989
// replace relative links to classes
9090
.replaceAll(/:class:`(\w*)`/gu, (_match, name) => resolveRelativeLink(declaration, name))
9191
// replace relative links to functions

0 commit comments

Comments
 (0)