-
Notifications
You must be signed in to change notification settings - Fork 2.8k
WIP: Syntax highlighting in code block #19813
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
base: main
Are you sure you want to change the base?
Conversation
Hi there @bjarnef, thank you for this contribution! 👍 While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:
Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution. If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request. Thanks, from your friendly Umbraco GitHub bot 🤖 🙂 |
@iOvergaard @leekelleher how can I reference/query Or perhaps is can be it can query similar to this (although I couldn't find the id searching the repository): Lines 11 to 12 in fb9a9b3
I think it is possible to register e.g. "Umbraco" as class to be highlighted in Monarch, but anyway it would be great for HTML, CSS, JS, JSON, XML etc. We can probably also use the |
When I formatted the existing element with slotted content, it seems to apply, but with empty content in the wrapping HTML elements. However when I use |
@warrenbuckley since you previously have worked with Monaco editor, perhaps you have some ideas for this? 😊 |
It seems I first needed to call ´colorizeElement()` which includes the CSS for the wrapping HTML elements, but the slotted content wasn't rendered. If I call For JSON it may need a bit more configuration. It seems it is also possible to use shiki to customize highlighter further: |
Prerequisites
Description
Attempt to use monaco API to format code in code block element, e.g. HTML, CSS, JavaScript/TypeScript, C# etc.
#16706
The additional code examples here are just inserted directly in query builder dialog just to test different formats.
chrome_M803a6EGAz.mp4