Skip to content

Added language string property to CodeBlockNode interface #68

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Thunberg087
Copy link

What does it do?

This PR adds a new language property to the CodeBlockNode interface. This field is of type string and specifies the programming language of the code block, enabling support for syntax highlighting and better parsing.

Why is it needed?

Previously, CodeBlockNode only included type and children, which made it impossible to identify the language of a code block. This enhancement is necessary to correctly render and process code blocks with language-specific formatting. Without this property, rendering engines or transformers might fail or default to plain text, leading to suboptimal UX.

How to test it?

Update the schema or types in your dev environment.

Add a CodeBlockNode with a language field (e.g., language: "javascript").

Ensure that any logic relying on the CodeBlockNode type (renderers, serializers, deserializers) now reads and uses the language field correctly.

Verify that type-checking fails if the language field is missing when required.

Related issue(s)/PR(s)

N/A (add a link here if this PR is related to a specific GitHub issue or another PR)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To be reviewed (Open)
Development

Successfully merging this pull request may close these issues.

2 participants