mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-07-22 20:02:50 +00:00
fix RSOD with format:variable operator
This commit is contained in:
parent
056a6daa58
commit
0662aa34f4
@ -310,17 +310,17 @@ exports.slowInSlowOut = function(t) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
exports.formatVariableString = function(template,options) {
|
exports.formatVariableString = function(template,options) {
|
||||||
var name = options.name || "",
|
var result = "",
|
||||||
params = options.params || "",
|
|
||||||
firstLine = "",
|
firstLine = "",
|
||||||
os = options.srcVariable,
|
name = options.name || "",
|
||||||
type = (os.isFunctionDefinition) ? "\\\\function" : (os.isMacroDefinition) ? "\\\\define" :
|
params = options.params || "",
|
||||||
|
os = options.srcVariable || options.name;
|
||||||
|
var type = (os.isFunctionDefinition) ? "\\\\function" : (os.isMacroDefinition) ? "\\\\define" :
|
||||||
(os.isProcedureDefinition) ? "\\\\procedure" : (os.isWidgetDefinition) ? "\\\\widget" : "",
|
(os.isProcedureDefinition) ? "\\\\procedure" : (os.isWidgetDefinition) ? "\\\\widget" : "",
|
||||||
varType = (os.isFunctionDefinition) ? "fn" : (os.isMacroDefinition) ? "macro" :
|
varType = (os.isFunctionDefinition) ? "fn" : (os.isMacroDefinition) ? "macro" :
|
||||||
(os.isProcedureDefinition) ? "proc" : (os.isWidgetDefinition) ? "widget" : "var";
|
(os.isProcedureDefinition) ? "proc" : (os.isWidgetDefinition) ? "widget" : "var";
|
||||||
var result = "",
|
var t = (!os.isFunctionDefinition && !os.isMacroDefinition && !os.isProcedureDefinition && !os.isWidgetDefinition) ? "$name$" : template;
|
||||||
t = (!os.isFunctionDefinition && !os.isMacroDefinition && !os.isProcedureDefinition && !os.isWidgetDefinition) ? "$name$" : template,
|
var matches = [
|
||||||
matches = [
|
|
||||||
[/^\$type\$/i, function() {
|
[/^\$type\$/i, function() {
|
||||||
return (type) ? type : "";
|
return (type) ? type : "";
|
||||||
}],
|
}],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user