Coder Social home page Coder Social logo

astride's People

Contributors

aureliendossantos avatar princesseuh avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

astride's Issues

Vote message trimming leads to broken URLs

Currently, the vote messages are simply trimmed by taking the first 175 characters (after having removed the tag), this can lead to broken URLs (and on the user side a weird punycode-like URL and ultimately a bad experience)

Simply making it so it doesn't cut words should be enough to fix this (and at the same time provide a better user experience)

Tags not matching the challenge case are not stripped away correctly from the votes messages

For instance, if the code for the challenge is "[Monstre]" and someone type "[monstre]" the vote message will contain the tag. Example in action :

exemple

Normally to fix this we'd just use lower() on the message but since we want to keep the end message intact (minus the tag) we'll have to do something else. Right now we simply use .replace() to find the tag but perhaps we could use a case insensitive regex?

Link detection is bad

(Undescriptive title, will have to edit)

Right now the link detection is pretty good for common links (i.e, imgur, classic discord link with normal file names etc) but fall apart as soon as a weird link come in. For instance, any links containing a dot after the hostname but before the extension will break the link detection. (For exemple, this link : https://images-ext-1.discordapp.net/external/w_r6GfytYi_sUA8eHMIwEUczNOQ6SIYIyHyvvMP0XWQ/https/nsa40.casimages.com/img/2019/06/17/19061703100787924.gif is not detected properly)

I fear for what would happen if someone posted a googlevideo link.

Right now the link detected is based on a pretty simple regex, just capturing the whole link, the hostname and the extension. The hostname group is currently unused but I'd like to use it in the future to provide custom integration for itch.io and youtube links. The extension group is only used to see if we can provide a thumbnail (admittedly, a naive way of doing it. Checking the mime-type might be a better solution?)

(Additionally, at the time of writing this, due to ^ at the beginning and $ at the end, it's just broken.)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.