Skip to content

fix: Set PageMerge to default to get merged content for plain SVGs#826

Merged
Myriad-Dreamin merged 2 commits intoMyriad-Dreamin:mainfrom
TeddyHuang-00:main
Jan 24, 2026
Merged

fix: Set PageMerge to default to get merged content for plain SVGs#826
Myriad-Dreamin merged 2 commits intoMyriad-Dreamin:mainfrom
TeddyHuang-00:main

Conversation

@TeddyHuang-00
Copy link
Contributor

Fixes #824

Explanation: The plain SVG target expected merged pages, while this is only true when the merge option is set in ExportSvgTask, so the simplest fix to this is to add a default PageMerge to the options.

This can be verified by adding the following test to simple-test.js:

console.assert(
  !!cc.plainSvg({
    mainFileContent: `
    #set page(width: auto, height: auto, margin: 0pt)

    Hello, Typst!
    `,
  }),
  'Simple test failed',
);

which, now with the fix, will pass.

P.S., it might be a good idea to expose this option to the node API, but that's a different topic and requires consideration. The current fix just get the failing compilation to work.

@TeddyHuang-00
Copy link
Contributor Author

Hi @Myriad-Dreamin, I know you're busy with other projects. This is just a gentle reminder that the CI is still awaiting your approval. Since GitHub doesn't always notify for new commits, I thought I'd reach out directly.

@Myriad-Dreamin
Copy link
Owner

@TeddyHuang-00 There are many backloged PRs in tinymist and I'm processing them. This PR looks good to me, and I will merge it quickly, but I may not make a typst.ts release in recent future :(.

@Myriad-Dreamin Myriad-Dreamin merged commit 9c94000 into Myriad-Dreamin:main Jan 24, 2026
23 checks passed
@TeddyHuang-00
Copy link
Contributor Author

There are many backloged PRs in tinymist and I'm processing them.

Totally understandable. Thank you for your awesome work, BTW.

I may not make a typst.ts release in recent future :(.

No worries. Since most people can just use svg over plainSvg, it shouldn't cause much issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

plainSvg target in NodeCompiler gets ImageOutput::Paged instead of ImageOutput::Merged

2 participants