- backup :
Object
- escape :
function
- posthtml-expressions ⇒
Object
Expressions Plugin for PostHTML
- loops :
function
- placeholders :
function
- tags :
function
- makeLocalsBackup(keys, locals) ⇒
Object
Creates a backup of keys values
- revertBackupedLocals(keys, locals, backup) ⇒
Object
Returns the original keys values
- escapeRegexpString(input) ⇒
function
Replace String based on RegExp
- executeLoop(params, p1, p2, locals, tree) ⇒
function
Creates a set of local variables within the loop, and evaluates all nodes within the loop, returning their contents
- executeScope(scope, locals, node) ⇒
function
Runs walk function with arbitrary set of local variables
- getLoopMeta(index, target) ⇒
Object
Returns an object containing loop metadata
- parseLoopStatement(input) ⇒
Object
Given a "loop" parameter from an "each" tag, parses out the param names and expression to be looped.
- escapeHTML(unescaped) ⇒
String
Escape HTML characters with their respective entities
- placeholders(input, ctx, settings, opts) ⇒
String
Replace Expressions
- getNextTag(nodes, i) ⇒
Array
Get the next tag from a node list
Requires: module:fclone
Properties
Name | Type | Description |
---|---|---|
make | function |
Make Locals backup |
revert | function |
Revert backuped Locals |
Expressions Plugin for PostHTML
Returns: Object
- tree PostHTML Tree
Requires: module:vm
, module:./tags
, module:./loops
, module:./escape
, module:./backup
, module:./placeholders
Version: 1.0.0
Author: Jeff Escalante Denis (@jescalan),
Denis Malinochkin (mrmlnc),
Michael Ciniawsky (@michael-ciniawsky)
License: MIT
Param | Type | Description |
---|---|---|
options | Object |
Options |
Creates a backup of keys values
Kind: global function
Returns: Object
- backup Backup Locals
Param | Type | Description |
---|---|---|
keys | Object |
Keys |
locals | Object |
Locals |
Returns the original keys values
Kind: global function
Returns: Object
- locals Reverted Locals
Param | Type | Description |
---|---|---|
keys | Object |
Keys |
locals | Object |
Locals |
backup | Object |
Backup |
Replace String based on RegExp
Kind: global function
Returns: function
- input Replaced Input
Param | Type | Description |
---|---|---|
input | String |
Input |
Creates a set of local variables within the loop, and evaluates all nodes within the loop, returning their contents
Kind: global function
Returns: function
- walk Walks the tree and parses all locals within the loop
Param | Type | Description |
---|---|---|
params | Array |
Parameters |
p1 | String |
Parameter 1 |
p2 | String |
Parameter 2 |
locals | Object |
Locals |
tree | String |
Tree |
Runs walk function with arbitrary set of local variables
Kind: global function
Returns: function
- walk Walks the tree and parses all locals in scope
Param | Type | Description |
---|---|---|
scope | Object |
Scoped Locals |
locals | Object |
Locals |
node | Object |
Node |
Returns an object containing loop metadata
Kind: global function
Returns: Object
- Object containing loop metadata
Param | Type | Description |
---|---|---|
index | Integer | Object |
Current iteration |
target | Object |
Object being iterated |
Given a "loop" parameter from an "each" tag, parses out the param names and expression to be looped.
Kind: global function
Returns: Object
- {} Keys && Expression
Param | Type | Description |
---|---|---|
input | String |
Input |
Escape HTML characters with their respective entities
Kind: global function
Returns: String
- escaped Save HTML
Param | Type | Description |
---|---|---|
unescaped | String |
Unsafe HTML |
Replace Expressions
Kind: global function
Returns: String
- input Replaced Input
Param | Type | Description |
---|---|---|
input | String |
Input |
ctx | Object |
Context |
settings | Array |
Settings |
opts | Array |
Options |
Get the next tag from a node list
Kind: global function
Returns: Array
- [] Array containing the next tag
Param | Type | Description |
---|---|---|
nodes | Array |
Nodes |
i | Number |
Accumulator |