PasteMe icon indicating copy to clipboard operation
PasteMe copied to clipboard

[Feature request] support for user defined sytanx highlighting

Open NamelessAshone opened this issue 5 years ago • 3 comments

It would be nice to add support for user defined sytanx highlighting.

NamelessAshone avatar Jan 03 '20 06:01 NamelessAshone

Thanks for suggestion. It's a little hard but we would consider this.

LucienShui avatar Jan 05 '20 09:01 LucienShui

Do you mean a new feature which is similar to this? https://microsoft.github.io/monaco-editor/playground.html#extending-language-services-custom-languages

ryanlee2014 avatar Feb 06 '20 10:02 ryanlee2014

Thanks for the reply :D

Simply use a file to specify the color of one token which is identified by regexp. This file contains pattern/color_code pairs. Like this

/regexp parttern/  <color code>|<named color>

/\[error.*/                #FF0000
/\[notice.*/               info
/\[info.*/                 info
/\[[a-zA-Z 0-9:]+\]/       #00FF00

By the way, Monaco Editor is too powerful.

NamelessAshone avatar Feb 06 '20 11:02 NamelessAshone