tag list in "status bar", closes #28

This commit is contained in:
azivner
2018-02-04 20:23:30 -05:00
parent 52817504d1
commit e18d0b9fd4
6 changed files with 64 additions and 5 deletions

View File

@@ -118,4 +118,18 @@ async function stopWatch(what, func) {
function executeScript(script) {
// last \r\n is necessary if script contains line comment on its last line
eval("(async function() {" + script + "\r\n})()");
}
function formatValueWithWhitespace(val) {
return /\s/.test(val) ? '"' + val + '"' : val;
}
function formatAttribute(attr) {
let str = "@" + formatValueWithWhitespace(attr.name);
if (attr.value !== "") {
str += "=" + formatValueWithWhitespace(attr.value);
}
return str;
}