marp-team / marp-core

The core of Marp converter
MIT License
797 stars 132 forks source link

[Regression] Auto-scaling for KaTeX block is always enable regardless of `@auto-scaling` theme metadata #353

Closed yhatt closed 1 year ago

yhatt commented 1 year ago

Version of Marp Tool

Marp Core v3.8.0

Operating System

Other (fill out in the environment field)

Environment

How to reproduce

Put the theme and Markdown into sandbox directory in Marp Core repository:

/* @theme test */

section {
  background: #fff;
}
---
theme: test
math: katex
---

# Auto-scaling for KaTeX <!--fit-->

$$
{1 + \frac{q^2}{(1-q)} + \frac{q^6}{(1-q)(1-q^2)} + \frac{q^{12}}{(1-q)(1-q^2)(1-q^3)} + \frac{q^{20}}{(1-q)(1-q^2)(1-q^3)(1-q^4)} + \frac{q^{30}}{(1-q)(1-q^2)(1-q^3)(1-q^4)(1-q^5)}} + \frac{q^{42}}{(1-q)(1-q^2)(1-q^3)(1-q^4)(1-q^5)(1-q^6)} + \frac{q^{56}}{(1-q)(1-q^2)(1-q^3)(1-q^4)(1-q^5)(1-q^6)(1-q^7)} + \frac{q^{72}}{(1-q)(1-q^2)(1-q^3)(1-q^4)(1-q^5)(1-q^6)(1-q^7)(1-q^8)} + \frac{q^{90}}{(1-q)(1-q^2)(1-q^3)(1-q^4)(1-q^5)(1-q^6)(1-q^7)(1-q^8)(1-q^9)} + \cdots = \prod_{j=0}^{\infty}\frac{1}{(1-q^{5j+2})(1-q^{5j+3})}, \quad\quad \text{for }\lvert q\rvert<1.
$$

And run yarn sandbox.

Expected behavior

Math block should not scale down to fit the slide, because the custom theme is not defined @auto-scaling metadata.

Actual behavior

Math block is scaling down to fit the slide.

Additional information

Reported in https://github.com/orgs/marp-team/discussions/159#discussioncomment-6955411.

This regression has been present since v3.0.0. In that version, the new auto-scaling component was produced, but the auto-scaling metadata was not taken into account.

Other scaling elements such as <!--fit--> are still following @auto-scaling correctly. In above example, <!--fit--> in the heading is just ignored by the theme.