Added language string property to CodeBlockNode interface #68
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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)