Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Simply parse all 0-99 irc colors #609

Merged
merged 1 commit into from
Jan 24, 2016
Merged

Simply parse all 0-99 irc colors #609

merged 1 commit into from
Jan 24, 2016

Conversation

xPaw
Copy link
Contributor

@xPaw xPaw commented Jan 24, 2016

This does a couple of things:

  • Removes the unnecessary colourMap array
  • Colors in invalid range (16-99) are ignored, even though the class is inserted into css (to allow for future style if needed), they remain uncolored

erming added a commit that referenced this pull request Jan 24, 2016
Simply parse all 0-99 irc colors
@erming erming merged commit 6f33b79 into erming:master Jan 24, 2016
@xPaw xPaw deleted the ignore-bad-colors branch January 24, 2016 15:12
@astorije
Copy link
Collaborator

Not even a chance to look at it, nice.

@@ -56,8 +56,8 @@ function uri(text) {
* https://github.com/megawac/irc-style-parser/tree/shout
*/
var styleCheck_Re = /[\x00-\x1F]/,
back_re = /^(\d{1,2})(,(\d{1,2}))?/,
colourKey = "\x03", colour_re = /\x03/g,
back_re = /^([0-9]{1,2})(,([0-9]{1,2}))?/,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why replacing \d with [0-9]? Aren't they the same?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Waouh, I'd pretend I didn't know that, but I also see I +1ed this answer more than 2 years ago :-)

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.

3 participants