Commit 8a140728 authored by Leon Arnott's avatar Leon Arnott
Browse files

Fixed two bugs.

 * Fixed a long-standing bug where passage elements added by header or footer tagged passages would have a HTML title attribute indicated the included passage's name.
 * Fixed a bug where (box:) and (float-box:)'s default interior padding was wrong in Chrome (but not Firefox).
parent 37b70baf2875
......@@ -6,6 +6,8 @@ Documentation is at http://twine2.neocities.org/. See below for compilation inst
#### Bugfixes
* Fixed a long-standing bug where passage elements added by header or footer tagged passages would have a HTML title attribute indicated the included passage's name.
* Fixed a bug where `(box:)` and `(float-box:)`'s default interior padding was wrong in Chrome (but not Firefox).
* Fixed a bug where `(after:)` would stop working (the hook wouldn't appear) when the mouse was clicked or a key was pressed, and the optional second value wasn't provided.
* Fixed a bug where `(click:?page)` would suppress a gradient background applied to ?Page via `(enchant:)` or `(change:)`.
* Fixed an incorrectly-worded error message resulting from a data name containing an error (such as `$a's (a: 1 to 2)`, which is invalid syntax).
......
......@@ -54,7 +54,7 @@ define(['jquery', 'utils', 'state', 'section', 'passages'],
setup passage source. Used in showPassage.
*/
function setupPassageElement(tagType, setupPassage) {
return "<tw-include type=" + tagType + " title='"
return "<tw-include type=" + tagType + " name='"
+ escape(setupPassage.get('name'))
+ "'>"
+ setupPassage.get('source')
......
......@@ -110,7 +110,7 @@ define(['jquery', 'utils'], ($, Utils) => {
},
/*
In TwineScript, both the runtime (operations.js) and Javascript eval()
In Harlowe, both the runtime (operations.js) and Javascript eval()
of compiled code (by compiler.js) can throw errors. They should be treated
as equivalent within the engine.
......@@ -124,14 +124,23 @@ define(['jquery', 'utils'], ($, Utils) => {
@return {Error|TwineError|Boolean} The first error encountered, or false.
*/
containsError(...args) {
return args.reduce(
(last, e) => last ? last
: e instanceof Error ? e
: TwineError.isPrototypeOf(e) ? e
: Array.isArray(e) ? TwineError.containsError(...e)
: false,
false
);
// Due to high usage, this is a simple for-loop.
for (let i = 0; i < args.length; i += 1) {
const e = args[i];
if (e instanceof Error) {
return e;
}
if (TwineError.isPrototypeOf(e)) {
return e;
}
if (Array.isArray(e)) {
const f = TwineError.containsError(...e);
if (f) {
return f;
}
}
}
return false;
},
/*
......
......@@ -2445,7 +2445,11 @@ define(['jquery','macros', 'utils', 'utils/renderutils', 'datatypes/colour', 'da
[name === "box" ? "margin-left" : "left"]: marginLeft + boxUnits,
"box-sizing": "content-box",
"overflow-y": "auto",
padding() { return $(this).css('padding') || '1em'; },
padding() {
const p = $(this).css('padding');
// Chrome compat hack: instead of an empty string, unpadded elements have "0px" padding.
return (p && p !== "0px") ? p : '1em';
},
};
if (height !== undefined) {
styles.height = height + (name === "box" ? "em" : "vh");
......
......@@ -597,10 +597,7 @@ define(['utils', 'passages', 'datatypes/changercommand', 'internaltypes/twineerr
newPresent(timeline[recent].passage);
return true;
}
return {
serialise: serialise,
deserialise: deserialise,
};
return { serialise, deserialise, };
})());
Object.seal(Moment);
......
{
"name": "twine-harlowe",
"version": "3.2.2",
"version": "3.2.3",
"author": "Leon Arnott",
"description": "The default runtime for Twine 2 stories",
"license": "Zlib",
......@@ -25,7 +25,7 @@
"dependencies": {
"almond": "0.3",
"es6-shim": "latest",
"jquery": "^3.5.1"
"jquery": "^3.6"
},
"devDependencies": {
"babel-cli": "^6.26.0",
......
......@@ -75,7 +75,7 @@ $zindex: 999999;
content: "<tw-align>";
}
tw-include::before {
content: "<tw-include type=\"" attr(type) "\" title=\"" attr(title) "\">";
content: "<tw-include type=\"" attr(type) "\" name=\"" attr(name) "\">";
}
}
......@@ -211,7 +211,7 @@ $zindex: 999999;
background-color: hsla(30,60%,50%,0.1);
&::before {
@include tiny-annotation();
content: attr(type) " \"" attr(title) "\"";
content: attr(type) " \"" attr(name) "\"";
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment