tailscale-dev / tclip

A pastebin for Tailscale users
BSD 3-Clause "New" or "Revised" License
154 stars 17 forks source link

fix: remove markdown hack #20

Closed jolheiser closed 1 year ago

jolheiser commented 1 year ago

GetLanguageByFilename appears to be for specially named files https://github.com/go-enry/go-enry/blob/master/data/filename.go

GetLanguageByExtension is (imo) the most likely way to match files, followed by special file names, and finally by content.

GetLanguage is likely the best general strategy, as seen in #26. This PR can most likely be closed as superseded, unless you'd like to use this PR as a more contained "enry update".

This also resolves the hack in place, as .markdown is already supported by enry. https://github.com/go-enry/go-enry/blob/93616cf55babb3e8d3b5ee143033c53511c7ce88/data/extension.go#L625

jolheiser commented 1 year ago

The various parts of the original PR have been implemented elsewhere, only thing left is removing the markdown hack since enry should now handle it correctly.