Skip to content

Commit

Permalink
deprecate old escape tags with slow warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jul 13, 2019
1 parent 6b935a3 commit bfe6ade
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import com.denizenscript.denizencore.utilities.CoreUtilities;
import com.denizenscript.denizencore.utilities.debugging.Debug;
import com.denizenscript.denizencore.tags.TagManager;
import com.denizenscript.denizencore.utilities.debugging.SlowWarning;

public class EscapeTags {

Expand Down Expand Up @@ -107,8 +108,10 @@ public static String unEscape(String input) {
.replace("&ns", "#").replace("&amp", "&");
}

public SlowWarning oldEscapeTags = new SlowWarning("'escape:' tags are deprecated. Please use '.escaped' element tags instead.");

public void escapeTags(ReplaceableTagEvent event) {
// TODO: Deprecate (in favor of element.escaped)
oldEscapeTags.warn(event.getScriptEntry());
if (event.matches("escape")) {
if (!event.hasValue()) {
Debug.echoError("Escape tag '" + event.raw_tag + "' does not have a value!");
Expand All @@ -119,7 +122,7 @@ public void escapeTags(ReplaceableTagEvent event) {
}

public void unEscapeTags(ReplaceableTagEvent event) {
// TODO: Deprecate (in favor of element.unescaped)
oldEscapeTags.warn(event.getScriptEntry());
if (event.matches("unescape")) {
if (!event.hasValue()) {
Debug.echoError("Unescape tag '" + event.raw_tag + "' does not have a value!");
Expand Down

0 comments on commit bfe6ade

Please sign in to comment.