diff --git a/docs/logic/lib/runic.js b/docs/logic/lib/runic.js
index 964e145..ce2e5d5 100644
--- a/docs/logic/lib/runic.js
+++ b/docs/logic/lib/runic.js
@@ -50,12 +50,22 @@ function Runic(raw)
var lines = raw;
var lines = !Array.isArray(raw) ? raw.split("\n") : raw;
- for(id in lines){
+ for(let id in lines)
+ {
var char = lines[id].substr(0,1).trim().toString()
var rune = this.runes[char];
+
var trail = lines[id].substr(1,1);
- if(char == "%"){ html += this.media(lines[id].substr(2)); continue; }
- if(char == "@"){ html += this.quote(lines[id].substr(2)); continue; }
+ if(char == "%"){
+ if(this.stash.is_pop(rune)){ html += this.render_stash(); }
+ html += this.media(lines[id].substr(2));
+ continue;
+ }
+ if(char == "@"){
+ if(this.stash.is_pop(rune)){ html += this.render_stash(); }
+ html += this.media(lines[id].substr(2));
+ continue;
+ }
var line = lines[id].substr(2).to_markup();
if(!line || line.trim() == ""){ continue; }
if(!rune){ console.log(`Unknown rune:${char} : ${line}`); }
@@ -75,7 +85,7 @@ function Runic(raw)
var stash = this.stash.pop();
var html = "";
- for(id in stash){
+ for(let id in stash){
var rune = stash[id].rune;
var line = stash[id].item;
html += rune.wrap ? `<${rune.sub}><${rune.wrap}>${line.replace(/\|/g,`${rune.wrap}><${rune.wrap}>`).trim()}${rune.wrap}>${rune.sub}>` : `<${rune.sub}>${line}${rune.sub}>`;
@@ -94,21 +104,21 @@ function Runic(raw)
this.media = function(val)
{
var service = val.split(" ")[0];
- var id = val.split(" ")[1];
+ let id = val.split(" ")[1];
if(service == "itchio"){
- return ``;
+ return ``;
}
if(service == "bandcamp"){
return ``;
}
if(service == "youtube"){
- return ``;
+ return ``;
}
if(service == "custom"){
return ``;
}
- return ``
+ return ``
}
this.quote = function(content)
@@ -156,7 +166,7 @@ String.prototype.to_markup = function()
html = html.replace(/{\#/g,"").replace(/\#}/g,"
")
var parts = html.split("{{")
- for(id in parts){
+ for(let id in parts){
var part = parts[id];
if(part.indexOf("}}") == -1){ continue; }
var content = part.split("}}")[0];
@@ -168,4 +178,7 @@ String.prototype.to_markup = function()
return html;
}
-
+String.prototype.toProperCase = function ()
+{
+ return this.replace(/\w\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});
+}
\ No newline at end of file