mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-07 07:50:26 +00:00
fix: use "" for string param
This commit is contained in:
parent
63613ceec0
commit
7b4ea476f3
@ -131,10 +131,8 @@ exports.parseImage = function(source,pos) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
exports.serialize = function(tree) {
|
exports.serialize = function(tree) {
|
||||||
// DEBUG: console tree
|
var width = tree.attributes.width ? " " + $tw.utils.serializeAttribute(tree.attributes.width) : "";
|
||||||
console.warn(`tree`, JSON.stringify(tree, null, ' '));
|
var height = tree.attributes.height ? " " + $tw.utils.serializeAttribute(tree.attributes.height) : "";
|
||||||
var width = tree.attributes.width ? " width=" + tree.attributes.width.value : "";
|
|
||||||
var height = tree.attributes.height ? " height=" + tree.attributes.height.value : "";
|
|
||||||
var padSpace = width || height ? " " : "";
|
var padSpace = width || height ? " " : "";
|
||||||
var tooltip = tree.attributes.tooltip ? tree.attributes.tooltip.value + "|" : "";
|
var tooltip = tree.attributes.tooltip ? tree.attributes.tooltip.value + "|" : "";
|
||||||
var source = tree.attributes.source.value;
|
var source = tree.attributes.source.value;
|
||||||
|
@ -207,7 +207,7 @@ describe('WikiAST serialization unit tests', function () {
|
|||||||
|
|
||||||
wiki.addTiddler({
|
wiki.addTiddler({
|
||||||
title: 'ImageTest',
|
title: 'ImageTest',
|
||||||
text: '[img[https://tiddlywiki.com/fractalveg.jpg]]\n[img width=23 height=24 [https://tiddlywiki.com/fractalveg.jpg]]\n[img width={{!!width}} height={{!!height}} [https://tiddlywiki.com/fractalveg.jpg]]\n[img[Description of image|https://tiddlywiki.com/fractalveg.jpg]]\n[img[TiddlerTitle]]\n[img[Description of image|TiddlerTitle]]',
|
text: '[img[https://tiddlywiki.com/fractalveg.jpg]]\n[img width="23" height="24" [https://tiddlywiki.com/fractalveg.jpg]]\n[img width={{!!width}} height={{!!height}} [https://tiddlywiki.com/fractalveg.jpg]]\n[img[Description of image|https://tiddlywiki.com/fractalveg.jpg]]\n[img[TiddlerTitle]]\n[img[Description of image|TiddlerTitle]]',
|
||||||
});
|
});
|
||||||
it('should serialize image tags correctly', function () {
|
it('should serialize image tags correctly', function () {
|
||||||
var serialized = $tw.utils.serializeParseTree(wiki.parseTiddler('ImageTest').tree).trimEnd();
|
var serialized = $tw.utils.serializeParseTree(wiki.parseTiddler('ImageTest').tree).trimEnd();
|
||||||
|
Loading…
Reference in New Issue
Block a user