Skip to content

docs(core): correct example code block formatting#3601

Merged
marvinhagemeister merged 1 commit into
freshframework:mainfrom
csvn:docs/csp-middleware-example
Nov 4, 2025
Merged

docs(core): correct example code block formatting#3601
marvinhagemeister merged 1 commit into
freshframework:mainfrom
csvn:docs/csp-middleware-example

Conversation

@csvn
Copy link
Copy Markdown
Contributor

@csvn csvn commented Nov 4, 2025

The example for the CSP middleware looks a bit broken currently on JSR, due to the @example markdown is not wrapped in a code block.

image

Changes

  • Improves formatting a bit, to be less compact
  • Wraps the example in a code block ```ts
  • Adds a title to the @example - "Basic usage" - To avoid the example being labeled as "Example1" on JSR

@csvn
Copy link
Copy Markdown
Contributor Author

csvn commented Nov 4, 2025

Hmm... giving titles to examples seems to break indentation of examples when using VSCode, which is kinda bad... microsoft/TypeScript#43955.

Which is more important, nicer documentation rendering on JSR, or correct rendering of tooltip in VSCode?

Copy link
Copy Markdown
Contributor

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we should make our LSP better to handle example code blocks.

@marvinhagemeister marvinhagemeister merged commit ffa845a into freshframework:main Nov 4, 2025
7 checks passed
@csvn csvn deleted the docs/csp-middleware-example branch November 4, 2025 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants