placeholders parsed after the javascript is evaluated need to use {}

Placeholders that use %<placeholder>% are parsed before the script is
evaluated so the ability to store or utilize raw placeholders was not
possible. Now if you use {<placeholder>}, placeholders with brackets are
parsed after the script has been evaluated.
This commit is contained in:
extendedclip 2018-03-08 15:37:00 -05:00
parent ebbeeb2062
commit 410b021b0b

View File

@ -218,11 +218,11 @@ public class JavascriptPlaceholder {
} }
if (result instanceof String) { if (result instanceof String) {
String res = PlaceholderAPI.setPlaceholders(p, (String)result); String res = PlaceholderAPI.setBracketPlaceholders(p, (String)result);
return res != null ? res : ""; return res != null ? res : "";
} }
return result != null ? PlaceholderAPI.setPlaceholders(p, result.toString()) : ""; return result != null ? PlaceholderAPI.setBracketPlaceholders(p, result.toString()) : "";
} catch (ScriptException ex) { } catch (ScriptException ex) {
PlaceholderAPIPlugin.getInstance().getLogger().severe("Error in javascript format for placeholder - " + this.identifier); PlaceholderAPIPlugin.getInstance().getLogger().severe("Error in javascript format for placeholder - " + this.identifier);