Support MIRC style terminators (^O)
This commit is contained in:
parent
3fc80efd7c
commit
a53544b44a
@ -50,6 +50,7 @@ function uri(text) {
|
|||||||
|
|
||||||
var regex = {
|
var regex = {
|
||||||
color: /\003([0-9]{1,2})[,]?([0-9]{1,2})?([^\003]+)/,
|
color: /\003([0-9]{1,2})[,]?([0-9]{1,2})?([^\003]+)/,
|
||||||
|
terminator: /\x0D/,
|
||||||
styles: [
|
styles: [
|
||||||
[/\002([^\002]+)(\002)?/, ["<b>", "</b>"]],
|
[/\002([^\002]+)(\002)?/, ["<b>", "</b>"]],
|
||||||
[/\037([^\037]+)(\037)?/, ["<u>", "</u>"]],
|
[/\037([^\037]+)(\037)?/, ["<u>", "</u>"]],
|
||||||
@ -59,6 +60,9 @@ function colors(text) {
|
|||||||
if (!text) {
|
if (!text) {
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
if (regex.terminator.test(text)) {
|
||||||
|
return $.map(text.split(regex.terminator), colors);
|
||||||
|
}
|
||||||
if (regex.color.test(text)) {
|
if (regex.color.test(text)) {
|
||||||
var match;
|
var match;
|
||||||
while (match = regex.color.exec(text)) {
|
while (match = regex.color.exec(text)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user