Skip to content
This repository has been archived by the owner on Apr 1, 2018. It is now read-only.

Added name highlighting #26

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

Inferno42
Copy link

Whenever the user's name is mentioned by another person the name is highlighted in red.

@WebFreak001
Copy link
Contributor

You should maybe escape the name for regex before testing, and also add \b before and after the name so it doesn't mark nicknames mid-word. This could also be combined with the new @nick syntax

@Inferno42
Copy link
Author

The pull now escapes the name and checks for @name if it has a space before it or a start line plus if it ends (The name) with a space or endline.

@AndrewBelt
Copy link
Owner

We shouldn't use LaTeX for coloring the names. Putting a <span> around it would be best, but I'd need to audit it for XSS.

On a general note, does anyone know how to match text in textContent and replace it with an HTML element containing the matched text, in a safe way?

@Inferno42
Copy link
Author

I'd imagine the easiest way to do something like that would be to scrub the change before putting it out, removing anything involving javascript (Including hex).

@M4GNV5
Copy link
Contributor

M4GNV5 commented Jul 12, 2015

you could also use a <code> tag afaik 😆

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants