abdelhamiderrahmouni / filament-monaco-editor

A Monaco Editor form field for FilamentPHP.
https://filamentphp.com/plugins/abdelhamid-errahmouni-monaco-editor
MIT License
11 stars 2 forks source link

Add custom JavaScript highlighter for Blade language support #10

Open caendesilva opened 5 months ago

caendesilva commented 5 months ago

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

caendesilva commented 5 months 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