Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

预览模式下粘贴公式到公众号公式尺寸异常 #540

Closed
drmingdrmer opened this issue Nov 20, 2020 · 4 comments
Closed

预览模式下粘贴公式到公众号公式尺寸异常 #540

drmingdrmer opened this issue Nov 20, 2020 · 4 comments
Assignees
Milestone

Comments

@drmingdrmer
Copy link

描述问题 Describe the problem

预览模式下粘贴公式到公众号, 公式尺寸异常

  • 文档代码:
对 slimarray 中一段数据的求和运算会变得非常高效,
对n个数字yᵢ的求和可以转化为简单的数值计算:

$$
\begin{aligned}
\sum y_i = & \sum\beta_0 + \sumβ_1 i + \sum \beta_2 i^2 + \sum d_i \\
         = & \beta_0 n \\
      & + \beta_1 \frac{1}{2} n (n+1) \\
      & + \beta_2 \frac{1}{6} n (n+1) (2n+1) \\
      & + \sum d_i
\end{aligned}
$$

ok
  • 点击 预览 后可以正常渲染:
    image
    image

  • 点击 复制到公众号, 在公众号 图文编辑器中粘贴, 得到的公式很小:
    image
    image

在Chrome里提取的粘贴后异常的公式的html代码:

<p><mjx-container jax="SVG" display="true" role="presentation" tabindex="0" ctxtmenu_counter="80" style=" direction: ltr;display: block;text-align: center;margin-top: 1em;margin-bottom: 1em;  "><embed width="41.674ex" height="20.538ex" style="vertical-align: -9.704ex;height: 20.538ex;" src="https://mmbiz.qlogo.cn/mmbiz_svg/CJ35Z2cnZA17uZ3NuM4B2flUc2ib3sCRd1Twr5GFMg7icbQmsrnXZBI3R7b2eSaLDLricBnDibaYhVLQ7TwqeMIWgialWibwWatk2k/0?wx_fmt=svg" data-type="svg+xml"><mjx-assistive-mml role="presentation" unselectable="on" display="block" style=" top: 0px;left: 0px;clip: rect(1px, 1px, 1px, 1px);user-select: none;width: 800px; padding-top: 1px !important;border-width: 0px !important;border-style: initial !important;border-color: initial !important;display: block !important;overflow: hidden !important; "><mtable displaystyle="true" columnalign="right left right left right left right left right left right left" columnspacing="0em 2em 0em 2em 0em 2em 0em 2em 0em 2em 0em" rowspacing="3pt"><mtr><mtd><mo data-mjx-texclass="OP"></mo><msub><mi>y</mi><mi>i</mi></msub><mo>=</mo></mtd><mtd><mo data-mjx-texclass="OP"></mo><msub><mi>β</mi><mn>0</mn></msub><mo>+</mo><mo data-mjx-texclass="OP"></mo><msub><mrow><mo>β</mo></mrow><mn>1</mn></msub><mi>i</mi><mo>+</mo><mo data-mjx-texclass="OP"></mo><msub><mi>β</mi><mn>2</mn></msub><msup><mi>i</mi><mn>2</mn></msup><mo>+</mo><mo data-mjx-texclass="OP"></mo><msub><mi>d</mi><mi>i</mi></msub></mtd></mtr><mtr><mtd><mo>=</mo></mtd><mtd><msub><mi>β</mi><mn>0</mn></msub><mi>n</mi></mtd></mtr><mtr><mtd><mo>+</mo><msub><mi>β</mi><mn>1</mn></msub><mfrac><mn>1</mn><mn>2</mn></mfrac><mi>n</mi><mo stretchy="false">(</mo><mi>n</mi><mo>+</mo><mn>1</mn><mo stretchy="false">)</mo></mtd></mtr><mtr><mtd><mo>+</mo><msub><mi>β</mi><mn>2</mn></msub><mfrac><mn>1</mn><mn>6</mn></mfrac><mi>n</mi><mo stretchy="false">(</mo><mi>n</mi><mo>+</mo><mn>1</mn><mo stretchy="false">)</mo><mo stretchy="false">(</mo><mn>2</mn><mi>n</mi><mo>+</mo><mn>1</mn><mo stretchy="false">)</mo></mtd></mtr><mtr><mtd><mo>+</mo><mo data-mjx-texclass="OP"></mo><msub><mi>d</mi><mi>i<mpchecktext contenteditable="false" id="1605842607093_0.9750672886889968"></mpchecktext></mi></msub></mtd></mtr></mtable></mjx-assistive-mml></mjx-container></p>

期待的结果 Expected result

期待如预览中正常大小的公式block.

版本环境 Version environment

  • 版本 Version:0.4.8
  • 操作系统 Operating system:MacOS Catalina
  • 浏览器(如果使用)Browser (if used):chrome 版本 86.0.4240.198(正式版本) (x86_64)

其他信息 Other information

Latex 引擎使用的MathJax


感谢作者, 很棒的编辑器!

@drmingdrmer
Copy link
Author

补充: 简单看了下代码, 这里有个embed的width属性:
image

去掉width属性后,显示就正常了:
image
image

@88250 88250 added this to the 0.5.0 milestone Nov 22, 2020
@88250
Copy link
Member

88250 commented Nov 22, 2020

你好,感谢帮忙反馈排查,后续会进行修复。

@88250 88250 changed the title 预览模式下粘贴公式到**公众号**, 公式尺寸异常 预览模式下粘贴公式到公众号公式尺寸异常 Nov 24, 2020
@drmingdrmer
Copy link
Author

为啥关闭了?🤔

@whzecomjm
Copy link

现在依然有此问题,部分公式会错位,暂时只能用 mdnice 了。

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

No branches or pull requests

4 participants