Fixed TMS does not inject code correctly

Adam Howard

Well-known member
OK applying this code manually into the template will give me a nice red heart next to any like given.

extra.css

PHP:
/* Add heart next to like */
.LikeText:before {
content: "\2665 \0020";
color: #FF0000;
font-size: 1.5em;
margin: 0 0 0 2px;
}
/* END Add heart next to like */

But when I have TMS add it; the result is something like this

www.sociallyuncensored.eu 2013-9-18 12 37 40.webp

So the code works... You can verify that by adding it to extra.css and liking a post. But for some reason TMS spits it out wrong.
 
As you're doing a regex, this is another method of replacing backreferences (from preg_replace). Use \\.

I don't think I can necessarily change this behavior due to backwards compatibility.
 
As you're doing a regex, this is another method of replacing backreferences (from preg_replace). Use \\.

I don't think I can necessarily change this behavior due to backwards compatibility.

This is what I'm currently trying to apply

Screenshot from 2013-09-18 13:16:24.webp


Exactly what are you suggesting as an alternative?
 
As you're doing a regex, this is another method of replacing backreferences (from preg_replace). Use \\.

I don't think I can necessarily change this behavior due to backwards compatibility.
I solved this.

You were talking about my code. Your "hint" was so vague I kept thinking you were suggesting about the code used in the "find" box.
 
I have now documented that backslashes should be escaped in the replacement content if using a regular expression match.
 
Just for a point of reference for anyone who may run into this problem & find this via google...

Was

PHP:
/* Add heart next to like */
.LikeText:before {
content: "\2665 \0020";
color: #FF0000;
font-size: 1.5em;
margin: 0 0 0 2px;
}
/* END Add heart next to like */

Now

PHP:
/* Add heart next to like */
.LikeText:before {
content: "\\2665 \\0020";
color: #FF0000;
font-size: 1.5em;
margin: 0 0 0 2px;
}
/* END Add heart next to like */

^ Basically \ turns into \\
 
Top Bottom