flora-pm / flora-server

A package index for the Haskell ecosystem
https://flora.pm/about
Other
126 stars 40 forks source link

Do not attempt to convert to HTML a changelog or a readme content if the file name ends with ".txt" #326

Open tchoutri opened 1 year ago

tchoutri commented 1 year ago

We should add a case check on the file name so that we do not attempt to convert to HTML a changelog or readme file whose name ends with ".txt".

lemonlambda commented 1 year ago

Is this still an issue? If not I would take a look at trying to fix it.

tchoutri commented 1 year ago

I believe so!

lemonlambda commented 1 year ago

This issue doesn't make sense because of line 59 and line 61

tchoutri commented 1 year ago

@LemonjamesD These routes in Hackage API give these resources in their original textual format, but it's only because Hackage can also send the generated HTML: image

However some READMEs and CHANGELOGs are in raw text, restructured text, org-mode what have you. Which means we need to check the extension of the name listed in the cabal file to see if it ends with ".md" or ".markdown".

lemonlambda commented 1 year ago

Ah okay, I'll take another look then