+1
-1
| { | ||
| "name": "remixml", | ||
| "version": "1.0.9", | ||
| "version": "1.0.10", | ||
| "description": "XML/HTML-like macro language/template engine", | ||
@@ -5,0 +5,0 @@ "browser": "remixml.js", |
+71
-2
@@ -54,13 +54,82 @@ <h1>Remixml</h1> | ||
| &scope.variablename:encoding%formatting; | ||
| - scope: References the primary level in the variables object (the second | ||
| argument to parse()). | ||
| - variablename: References second and deeper levels in the variables | ||
| object (can contain multiple dots to designate deeper levels, is used | ||
| to access both objects and arrays). | ||
| - encoding (optional): | ||
| Specifies the encoding to be used when substituting the variable. | ||
| The encodings available are: | ||
| - html (default, encodes using HTML entities). | ||
| - uric (URI component, encodes URI arguments in an URL). | ||
| - none (no encoding, as is, can be abbreviated as :;). | ||
| - formatting (optional): | ||
| sprintf()-like formatting specification. | ||
| Supported formats: %c, %d, %e, %f, %g, %s, %x. | ||
| If the formatting string equals a three-letter currency (all capitals), | ||
| the value will be formatted like a currency (including currency symbol) | ||
| in the current locale. | ||
| ### Language statements | ||
| Simple assigment: | ||
| ```html | ||
| <set var="_.variablename">the new value</set> | ||
| ``` | ||
| Simple calculations: | ||
| ```html | ||
| <set var="_.variablename" expr="_.variablename + 1"></set> | ||
| ``` | ||
| Conditionals: | ||
| ```html | ||
| <if expr="_.variablename > 1"> | ||
| yes | ||
| </if> | ||
| <elif expr="_.variablename == 'foobar'"> | ||
| second condition valid | ||
| </elif> | ||
| <else> | ||
| otherwise | ||
| </else> | ||
| ``` | ||
| Counted loop: | ||
| ```html | ||
| <for from="1" to="42"> | ||
| This is line &_._recno;<br /> | ||
| </for> | ||
| ``` | ||
| Iterating through an object or array: | ||
| ```html | ||
| <for in="&_.variablename;"> | ||
| This is line &_._recno;<br /> | ||
| </for> | ||
| ``` | ||
| ### API | ||
| ## Official website | ||
| #### Reserved object variables | ||
| - $.sys.lang | ||
| If set, it overrides the default locale of the browser environment | ||
| (currently only used during currency formatting). | ||
| ## References | ||
| Soon to be launched: | ||
| - The [Remixml website](http://remixml.org/). | ||
| - For historical reference: Remixml was originally inspired by | ||
| - For historical reference:<br /> | ||
| Remixml was originally inspired by | ||
| [RXML, the Roxen webserver macro language](http://docs.roxen.com/). | ||
+7
-9
@@ -90,3 +90,3 @@ // RemixML v1.0: XML/HTML-like macro language | ||
| } else | ||
| j = ""; | ||
| $._._ok = 0, j = ""; | ||
| return j; | ||
@@ -306,5 +306,5 @@ } | ||
| t._value = e[j]; | ||
| res.appendChild(newctx([n, sc], t)); | ||
| res.appendChild(newctx([n, sc], t)); _._ok = 1; | ||
| } | ||
| n.normalize(); | ||
| n.normalize(); _._ok = 0; | ||
| if (j = gatt("in")) | ||
@@ -349,8 +349,6 @@ if ((e = fvar(j, $)) && e.length >= 0) | ||
| if (e = gatt("var")) { | ||
| e = insert(e, gatt("quote"), gatt("format"), $); | ||
| if ((j = +gatt("offset")) | ||
| || (k = gatt("limit")) != null) { | ||
| _._ok = 1; e = insert(e, gatt("quote"), gatt("format"), $); | ||
| if ((j = +gatt("offset")) || (k = gatt("limit")) != null) | ||
| e = castxt(e).substr(j, +k); | ||
| } | ||
| if (ret(insert(e, gatt("quote"), gatt("format"), $))) | ||
| if (ret(e)) | ||
| continue; | ||
@@ -461,3 +459,3 @@ break; | ||
| W.Remixml = Remixml; | ||
| if (typeof define == "function" && define.amd) | ||
| if (W.define && define.amd) | ||
| define(Remixml); | ||
@@ -464,0 +462,0 @@ if (W.exports) |
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
17425
9.83%135
104.55%438
-0.45%