abdelhamiderrahmouni / filament-monaco-editor

A Monaco Editor form field for FilamentPHP.
MIT License
11 stars 1 forks source link

Add custom JavaScript highlighter for Blade language support #10

Open caendesilva opened 1 week ago

caendesilva commented 1 week ago

Currently a proof of concept to fix https://github.com/abdelhamiderrahmouni/filament-monaco-editor/issues/4

caendesilva commented 1 week ago

Running into some issues with the actual editor. My original POC worked when using a readonly view with syntax highlighting where I could just replace the highlighted HTML. Here that doesn't work in the editor, because the decorated HTML can't be rendered without making it readonly.

Either this happens: (All HTML is rendered) image

Or this happens: (No HTML is rendered) image

I still think we can get this to work using Ranges and/or Decorators, it just takes some detective work since Monaco is so poorly documented.

See https://stackoverflow.com/questions/46829158/wrap-monaco-ranges-in-custom-html-tags See https://github.com/microsoft/monaco-editor/issues/1070