Giter Site home page Giter Site logo

Comments (7)

spaceface777 avatar spaceface777 commented on May 27, 2024

Duplicate of #6

from hermes.

spaceface777 avatar spaceface777 commented on May 27, 2024

Duplicate of #6

In the end, although #6 had two parts, we only implemented the second one and not this one.

from hermes.

Tloru avatar Tloru commented on May 27, 2024

mentioning would just be quoting without the reference message, right? Couldn't we just extend the quote regex and update on the GUI?

from hermes.

ThePerkinrex avatar ThePerkinrex commented on May 27, 2024

Yes, probably that could be the solution

from hermes.

ThePerkinrex avatar ThePerkinrex commented on May 27, 2024

I will look into it

from hermes.

spaceface777 avatar spaceface777 commented on May 27, 2024

Another option would be to add another regex (@([^ ]+) for example), check if the matched string is in the user_colors object, and if it is replace the whole thing with a formatted version of the string:

<b style="color: #color">regex[1]</b>

(This isn't the exact code we should use as this is XSS vulnerable and can be VERY optimized, but the idea should be more or less similar)


EDIT: A better version using JQuery could be this:

let regex = message.match(/@([^ ]+)/) [1]
$('<b>').css('color', user_colors[regex].color).text(regex)

from hermes.

spaceface777 avatar spaceface777 commented on May 27, 2024

Most of the work has been done in 3a28db4, but there are still some things left to be done.

from hermes.

Related Issues (20)

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.