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
Powershell highlighting enhancements #88
Comments
powershell support has been added to EnlighterJS some month ago. |
WOW! Thats fantastic. Thanks!! |
I don't see any diffrence in highliting between shellscript and powrshell. Am i doing something wrong ? |
maybe. but without additional information i'm unable to help your (url..) |
Webpage still in progress |
everything looks fine in point of highlighting...but you're using it in a wrong way... the highlighting is designed to highlight powershell script and NOT interactive console sessions including command output or especially the PS1 prompt sequence like example: #23 (comment) |
Got it. |
the current highlighting rules such match nearly all common patterns. which one doesn't work ? |
FE $art=$line | select-string -Pattern select-string is not highlited. Get-ADuser is also not highlited. ps. Thanks for support, You are great! |
I think I got it. In Regex You check for the first big letter in command! |
i thought that uppercase character is the standard used in powershell ? (i'm not familiar with powershell -> bash user ;)) |
windows is not case sensitive :) You can write whatever you like. Also there are a lot of aliases (select for select-object). I now where to change it and i will think of that if it will bother me 👍. |
ok, i've changed the regex to: /\b([A-Z]\w+(?:-\w+)+)\b/gi |
I know where to change it in the Js source code, but where to look for that in the plugin itself ? |
you have to rebuild the library EnlighterJS library path: https://github.com/EnlighterJS/Plugin.WordPress/tree/master/resources/enlighterjs |
that will be hard.... ;) I have no compiling tools and almost zero knowledge :) |
dirty workaround: search+replace within the minified js file ;) |
IS there something more that needs to be done ? |
clear your browser cache and press "save settings" within the Enlighter settings page |
Can You also add the parameters of the commandlets to the highliting? |
there are two possible ways to create/derive themes:
regarding the parameters within highlighting: do you have any examples or official references ? does it match any of the symbols (exact match) ? |
Thanks.
Please check this sample from MS docs.
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/get-command?view=powershell-6
Its build like this "get-command -function value"
"-function" is a Word (i dont know any alfanumerical) so it should be
doable with regex (magic for me).
Also your regex marks xxxx-zzzz-dddd-sssss as command.
Cheers!
|
After putting the x.min.css file to /themes/enlighter I choose external Themes, but the theme doesn't appear in the theme list (i also did disable Enlighter themes). Enlighting is still done in the selected theme (or no highliting is done if the main ones are disabled). |
the path for custom themes is
p.s. i've forgot to add the closing backtick to the path in my post above |
Now I can see this in the selection list! Greeat! :) |
remove the theme name: btw. NEVER use theme names used by the enlighter plugin for your custom themes |
When I take dracula or atomic css and change the background color - they stay the same (default ones). When I change the droid them, changing the background color works like a charm. Where is the difference ? |
it causes an unexpected behaviour. rename the theme and everything is fine OR disable all EnlighterJS css resources and enqueue the EnlighterJS theme (including the second line) manually |
You misunderstood me. |
oh ok sry. did you checked the css classes with chrome/firefox developer tools (inspect element) ? maybe the css enqueue order is wrong or some styles get overridden |
I still have some problems with themes. |
currently the base styles (second line of the |
Finally! I got what I wanted! |
Hi. I love Your plugin, it's great.
I found out, that there is no plugin for wordpress that higlights powershell correctly.
Can You add support for Powershell ?
Thanks!
Bartosz Pawlak
The text was updated successfully, but these errors were encountered: