Skip to content

Made etc-hosts path regex match more strict + Added shebang matching for PHP executables without extension#386

Open
bravoman wants to merge 2 commits intoscopatz:masterfrom
bravoman:master
Open

Made etc-hosts path regex match more strict + Added shebang matching for PHP executables without extension#386
bravoman wants to merge 2 commits intoscopatz:masterfrom
bravoman:master

Conversation

@bravoman
Copy link
Copy Markdown

@bravoman bravoman commented Jan 3, 2022

This got me in a lot of trouble with a file path containing /vhosts/ so I made it more strict.

This got me in a lot of trouble with a file path containing /vhosts/ so made it more strict.
Should also match:
#!/usr/bin/env php
#!php
@bravoman bravoman changed the title Made etc-hosts path regex match more strict. Made etc-hosts path regex match more strict + Added shebang matching for PHP executables without extension Jan 3, 2022
@bravoman
Copy link
Copy Markdown
Author

bravoman commented Jan 3, 2022

The failed build does not seem to be a result of my changes.

Copy link
Copy Markdown
Contributor

@davidhcefx davidhcefx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

galenguyer pushed a commit to galenguyer/nano-syntax-highlighting that referenced this pull request Nov 2, 2022
This got me in a lot of trouble with a file path containing /vhosts/ so made it more strict.

Originally proposed in scopatz#386
galenguyer pushed a commit to galenguyer/nano-syntax-highlighting that referenced this pull request Nov 2, 2022
Should also match:
#!/usr/bin/env php
#!php

Originally proposed in scopatz#386
galenguyer pushed a commit to galenguyer/nano-syntax-highlighting that referenced this pull request Nov 2, 2022
This got me in a lot of trouble with a file path containing /vhosts/ so made it more strict.

Originally proposed in scopatz#386
galenguyer pushed a commit to galenguyer/nano-syntax-highlighting that referenced this pull request Nov 2, 2022
Should also match:
#!/usr/bin/env php
#!php

Originally proposed in scopatz#386
Efreak pushed a commit to Efreak/nanorc that referenced this pull request Sep 28, 2023
This got me in a lot of trouble with a file path containing /vhosts/ so made it more strict.

Originally proposed in scopatz#386
mpql added a commit to mpql/nanorc that referenced this pull request Nov 9, 2023
* [Nginx] Update directives

- Full list of directives updated from: http://nginx.org/en/docs/dirindex.html
- Deleted 3 keywords, added 233 keywords

* [Python] Improve colorings and fix bugs

- Improve colorings based on iPython (colors=Linux):
    - Green for exceptions and function names.
    - Red for keywords such as `from` and `not`.
    - Cyan for keywords such as `for` and `if`.
- Fix empty strings not correctly highlighted.
- Fix block comments not correctly highlighted when nothing follows `===`.
- Add support for "TODO".

* Force all syntax regex to ends with $

- Lots of syntax regex are poorly written and did not ends with a '$',
   which caused them competing with other regex rules.

* no octave.nanorc in .nano/nanorc

* Apply hcl to "nomad" extension

* nanorc.nanorc: icolor normal instead of brightnormal

Fixes complaint from GNU nano from git, v6.3-7-g18a40caa:

Error in /home/vorburger/dev/nanorc/nanorc.nanorc on line 26: Color 'normal' takes no prefix

* nanooo

* maj

* Update Dockerfile

* Update Dockerfile

* add solidity highlighting

* add zeek highlighting

* fix highlighting for v2.9.*

Get rid of message `Error in /usr/share/nano-syntax-highlighting/etc-hosts.nanorc on line 11: Color "normal" not understood.` after nano exits.

* update documentation and installation script for v2.9 branch

* remove comment syntax for compability with v2.3

* Update prolog.nanorc

* Update prolog.nanorc

* fix script run on Ubuntu 18.04

  inflating: nanorc-2.9/zsh.nanorc
    linking: nanorc-2.9/zshrc.nanorc  -> zsh.nanorc
finishing deferred symbolic links:
  nanorc-2.9/gitcommit.nanorc -> git.nanorc
  nanorc-2.9/html.j2.nanorc -> html.nanorc
  nanorc-2.9/zshrc.nanorc -> zsh.nanorc
+ mv 'nanorc-v2.9/*' ./
mv: cannot stat 'nanorc-v2.9/*': No such file or directory
+ rm -rf nanorc-v2.9
+ rm /tmp/nanorc.zip
+ '[' ']'
+ _update_nanorc
+ touch /c/Users/home/.nanorc
install.sh: line 20: /c/Users/home/.nano/nanorc: No such file or directory

* New Readme file, with more organised information.

* Fix heading levels, remove quote sections

* Fixed readme errors and wording

* Fix block comments highlighting

Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>

* Update .gitignore

* Update nanorc.nanorc

* * PHP: Fix highlighting of special values

* * XML: Enhance with different opening/closing tag colors

* * Yaml: Fix highlighting of spaces

* Create shellcheck.yml

* CI: migrate from Travis CI to Github Actions

- Removed .travis.yml and shellcheck.sh
- Added CI badge to README

* CI: Add highlight_test and badges

* [C] Add highlightings for "TODO" and g++ linter

* [PowerShell] Various Enhancements Based on highlight.js

- Basing on highlight.js, I enhanced the highlighting rules in various aspects.
- See also: scopatz#358

* Fix shellcheck error

* Enhancements: Batch, HTML, JS

- [Batch] Fix that using "::" as comments sometimes failed
- [html] Tabs give 2 spaces by default
- [JS] Tabs give 2 spaces by default; Allow comments to be inline with code.
- [Sh] Also highlight PKGBUILD; Fix `${v%tail}` not highlighted; Use shellcheck as linter

* [test] Adapt new error message and new behavior

- New error message "Standard input is not a terminal" should be ignored.
- nano changed its behavior to produce error messages AFTER program exited.

* Added matching for shebang headers like #!/bin/php

Should also match:
#!/usr/bin/env php
#!php

* Ditto in .zsh files

* Update yaml.nanorc

It's valid for yaml files like this to exist:
```yaml
- my
- list
- of
- strings
```

* mdown

* Add .typescript and .javascript support

* feat: add create-branches.sh

* fix create-branches script to work upstream

* Create switch-branch.sh

* chmod +x switch-branch.sh

* fix: rename to pre-5.0 color names

* fix: comment out 4.5's tabgives

* Add syntax highlighting for pipe operator in elixir.nanorc file

* Add syntax highlighting for Expect scripts. File is a copy of tcl.nanorc
with Expect commands added (Expect is a TCL extension).

* Modified expect.nanorc

* Added Zig to default nanorc

* Fixed Zig nanorc file

* markdown heading fix and added tagging

* color fix

* comments

Removed commented lines and adjusted heading comments

* fix(hcl): only highlight keywords when they're actually keywords

* Syntax highlighting for Julia

* Few more unicode operators

* handle transpose operator

* Remove syntax error

* [ps] Change to a more mainstream color-coding convension

- Use the same coding convension as most languages' (eg. bash) highlighting colors.

* [powershell] Various enhancements

- Commands:
    - remove not workable regex
    - change to use *official-approved verbs* instead
    - add 157 builtin aliases
- Comparison operators:
    - add 47 more operators not been covered
- Keywords (statement):
    - add 28 more keywords not been covered
- Types:
    - add 14 new types highlighting
- Comments:
    - fix a buggy case of block comment
- Quoted text:
    - add a here-string case not been covered

* Including mdx as part of the markdown.nanorc

* Improved and separated ledger and beancount syntaxes

* Fix heading levels, remove quote sections

* fix(yaml): highlighting of spaces

Originally proposed in scopatz#378

* feat(subrip): Add subrip.nanorc

Originally proposed in scopatz#380

* fix(etc-hosts): Made path regex match more strict.

This got me in a lot of trouble with a file path containing /vhosts/ so made it more strict.

Originally proposed in scopatz#386

* fix(git): Git uses tabs in config files, we should warn on spaces but not tabs

* fix(js): fix cotal -> octal typo

* chore(powershell): Add note about comment syntax seeming a bit off

* chore(readme): Update readme with fork information

* Update name extracted from master.zip

The master.zip contains a folder "nano-syntax-highlighting-master" now in the fork where originally it extracted as "nanorc-master".

---------

Signed-off-by: Harsh Shandilya <msfjarvis@gmail.com>
Co-authored-by: davidhcefx <davidhu0903ex3@gmail.com>
Co-authored-by: KaKooDa <123723958+KaKooDa@users.noreply.github.com>
Co-authored-by: André <andre.peters@debinux.de>
Co-authored-by: Michael Vorburger ⛑️ <mike@vorburger.ch>
Co-authored-by: 0x07CB <83157348+0x07CB@users.noreply.github.com>
Co-authored-by: ak <a@k>
Co-authored-by: Ondřej Ešler <esler@users.noreply.github.com>
Co-authored-by: Ondřej Ešler <ondrej.esler@intraworlds.com>
Co-authored-by: Nicolas Vitaterna <nvitaterna@gmail.com>
Co-authored-by: Muhammad Hussein Fattahizadeh <m@mhf.ir>
Co-authored-by: CSRedRat <csredrat@gmail.com>
Co-authored-by: Tiago Almeida <tjamadeira@gmail.com>
Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
Co-authored-by: CryptoDragonLady <celeste.weingartner@gmail.com>
Co-authored-by: Harsh Shandilya <msfjarvis@gmail.com>
Co-authored-by: hdquemada <44162051+hdquemada@users.noreply.github.com>
Co-authored-by: Hector Quemada <hdquemada@gmail.com>
Co-authored-by: Zach DeCook <zdecook@ccel.org>
Co-authored-by: bravoman <bravoman@me.com>
Co-authored-by: Samantaz Fox <coding@samantaz.fr>
Co-authored-by: Will Stott <willstott101@gmail.com>
Co-authored-by: Yash Singh <saiansh2525@gmail.com>
Co-authored-by: Ross Smith II <ross@smithii.com>
Co-authored-by: Francine Guimarães <francinesguimaraes@outlook.com>
Co-authored-by: Dennis Rardin <dennis@rardin.net>
Co-authored-by: Exonorid <exonorid@gmail.com>
Co-authored-by: Bruce DuPlanty <bduplanty@gmail.com>
Co-authored-by: Bruce <33303709+bduplanty@users.noreply.github.com>
Co-authored-by: Gareth Jones <Jones258@Gmail.com>
Co-authored-by: Tymoteusz Wołodźko <twolodzko+git@gmail.com>
Co-authored-by: Tymoteusz Wołodźko <twolodzko@users.noreply.github.com>
Co-authored-by: Feixu <feixu@tutanota.com>
Co-authored-by: Mike Foden <mike@mikefoden.com>
Co-authored-by: AlphaJack <alphajack@tuta.io>
Co-authored-by: Sven Wick <sven.wick@gmx.de>
Co-authored-by: Galen Guyer <galen@galenguyer.com>
Co-authored-by: Simon Thyßen <simon.thyssen@gmx.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants