Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Lovely little product !

I wanted to ask how you handle language autodetection for snippets.



Hey! thank you! I actually have a great use for my site itself, you can find the language detection utility on this list: https://snippp.io/list/18

but tldr I'm using hljs to detect and return a string with the language title, and comparing that key against my array of categories.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: