Repository navigation
fix: address the 0.9.0 pre-release review - #225
Merged
Merged
Conversation
…checks From the 0.9.0 pre-release review: - fetchImageLoader's time budget relied on the injected fetch honoring its abort signal. A fetch that ignored it, or a body stream not tied to it, never settled, and the cache then handed the pending promise to every later load of that URL. The budget now settles the load itself, and the failed load is dropped from the cache as before. The docs show a service binding's fetch wrapped so it keeps its binding. - `localhost.` and `*.localhost.` (fully qualified) are refused like `localhost` without allowPrivate. - definePlate rejects a contentType that is not a lowercase media type with no parameters (such as "IMAGE/PNG" or "image/jpeg; q=1"), which every renderer factory would otherwise reject later as a mismatch.
…tatic HTML pages A page saved with a byte order mark failed preflight, because the mark read as body text: it is now split off before splicing and the crawler scan and put back on write, so the file keeps its bytes and a re-run stays byte-identical. The block was inserted before the first </head> in the text, even one inside a comment, which could end the head early and leave a stray --> in the body. The insertion point now comes from the same tokenizer extractPageSocialMetadata uses, so a </head> in a comment, <script>, <style>, or <template> is skipped; a page whose head ends before its </head> is refused with a clear message.
…i does Takumi's own image fetcher fetched <img src> and CSS url() with no address policy. Render options now refuse every URL (allowUrl plus a refusing fetch), so a render makes no request: data URIs still draw, and any other source fails the render with an error naming the URL and pointing to fetchImageLoader. The emoji loader now receives the grapheme as the copy spells it (1️⃣, ❤️ with U+FE0F) instead of Takumi's stripped image name, and missingGlyphs reports that spelling.
The guard started every element at weight 400, style normal, so a heading drawn bold with only the bold face loaded was reported, and bold or italic text from <h1>, <strong>, or <em> with only the regular face was not. Each element now starts from Satori's default style for its tag (Takumi's under createTakumiOg), and var() in font properties resolves from custom properties declared in inline styles; an unresolvable var() family is skipped.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A final review of everything going into 0.9.0 found no blockers in the code. It did find three should-fix defects and several minor ones in features that are not released yet. This PR fixes all of them, so no CHANGELOG
Fixedentries are needed: the affectedAddedentries now describe the corrected behavior.Should-fix
metaplate/takumino longer lets Takumi fetch images. Takumi's own fetcher used to load<img src>and CSSurl()with no address policy; a loopback URL was fetched, whilemetaplate/noderefuses the same plate. Takumi now gets animages.allowUrlandfetchthat refuse every URL. A non-data:source fails the render before any request, with an error pointing tofetchImageLoader.data:URIs and emoji still draw. This is stricter than Satori, which fetches public URLs itself;docs/takumi.mddocuments the difference.fontFallbackuses each renderer's tag defaults. Satori makesh1–h6,bandstrongbold andemandiitalic, and Takumi has its own table (strongisbolder,thbold,citeitalic, and so on). The guard used to assume 400 normal everywhere. That made a correct<h1>plate fail aterrorlevel and missed bold or italic text falling back to the wrong face.var()values in inline styles are resolved now, and an unresolvedvar()family is skipped instead of being checked against the first font.metaplate renderkeeps a UTF-8 BOM in HTML pages. It used to reject any page that started with a BOM, with an error about crawlers that pointed at the wrong cause.Minor
</head>a crawler reads. A commented-out</head>(or one inside a script, style or template) is skipped; it used to receive the block and leave a stray-->in the body.fetchImageLoader: the time budget settles the load even when an injectedfetchignores its abort signal or returns a body stream not tied to it. Before, the load hung and the cache served the pending promise to every later call.localhost.and*.localhost.are refused likelocalhost. The docs show a service binding'sfetchwrapped so it keeps its binding.1️⃣, not1⃣), andmissingGlyphsreports it in that form.definePlaterejects acontentTypethat every renderer factory would reject later ("IMAGE/PNG","image/jpeg; q=1").Test plan