enchant97/hasty-paste

Auto Syntax Highlighting

modem7 opened this issue · 4 comments

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
Hastebin offers a way to automatically detect (granted, not always perfect) the syntax highlighting and applies to the code automatically.

Feature 1:

  • Allow for empty highlighting

Feature 2:

  • Allow for auto highlighting, with changable language in URL (possibly the simplest way (maybe?)).

For example:

This would allow for easy syntax highlighting changes post paste also in case a user got it wrong the first time/found a better highlighting language for something non-standard.

Describe alternatives you've considered
n/a

Additional context
n/a

If you are often pasting the same language, it'd be nice to pin preferred languages to the top of the list. This would likely need some kind of user management also.

If you are often pasting the same language, it'd be nice to pin preferred languages to the top of the list. This would likely need some kind of user management also.

Whilst a nice wishlist, definitely far more complex if there's user management.
Maybe store values in cookies instead in the interim? Although again, potentially complex.

@modem7

Allow for empty highlighting

If you mean turn off syntax highlighting, you can do this just by leaving the box blank. (although 1.2.0 had a bug where you couldn't select it, now fixed in 1.2.1).

Allow for auto highlighting

At the moment I don't think I will be implementing this

URL with syntax name

That sounds possible. Although the requirement will be that the URL with no extension will still read the syntax name from what was set during creation.

@petersem Although user management would open up lots of new possibilities I don't think it fits the project's goal of being lightweight (due to limited features). I can however implement pinning of a top language through the browser's local storage api.

Allow for empty highlighting

If you mean turn off syntax highlighting, you can do this just by leaving the box blank. (although 1.2.0 had a bug where you couldn't select it, now fixed in 1.2.1).

Ahhah! That must have been why then!

URL with syntax name

That sounds possible. Although the requirement will be that the URL with no extension will still read the syntax name from what was set during creation.

That'd be absolutely perfect!