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

多出来的 ** #126

Open
marxangels opened this issue Oct 13, 2023 · 4 comments
Open

多出来的 ** #126

marxangels opened this issue Oct 13, 2023 · 4 comments

Comments

@marxangels
Copy link

以下HTML结构会导致多余的星号出现

image

粘贴结果出现了多余的星号

image

网页原文是正常的,并没有多余的星号

image

@telesoho
Copy link
Owner

@marxangels

<html>

<body>
    <p>
        <strong></strong>
        <strong><span>中文</span></strong>
        <strong><span>:</span></strong>
        <strong><span>符号<span>阿保持</span></span></strong>
    </p>
    <p>
        <strong></strong>
        <strong><span>abc</span></strong>
        <strong><span>:</span></strong>
        <strong><span>abc<span>afdfd</span></span></strong>
    </p>
</body>

</html>

我用上面的HTML粘贴后结果是:

**中文** **:** **符号阿保持**

**abc** **:** **abcafdfd**

并没有发现多余的星号。猜想可能是原始的HTML文件不规范,存在标签Tag不匹配的问题。
另外尽可能的提供原始的HTML代码,方便检查问题,而不是贴图。

@marxangels
Copy link
Author

双宇论(上).zip
@telesoho 感谢解答,以上是导出的文件。

@marxangels
Copy link
Author

也可能有浏览器版本的原因

Google Chrome
正在更新 Chrome (62%)
版本 117.0.5938.150(正式版本) (64 位)

@telesoho
Copy link
Owner

@marxangels

如果把HTML单独写作一行,没有按缩进格式化

<html>
  <body>
    <p>
      <strong><span>误解三</span></strong><strong><span></span></strong><strong><span><span>量子态没有能量</span></span></strong>
    </p>
  </body>
</html>

转换后的结果是

**误解三********量子态没有能量**

粗体符号连到了一块,就会出现多余的*号

如果是格式化以后HTML:

<html>
  <body>
    <p>
      <strong>
        <span>误解三</span>
      </strong>
      <strong>
        <span></span>
      </strong>
      <strong>
        <span>
          <span>量子态没有能量</span>
        </span>
      </strong>
    </p>
  </body>
</html>

就能输出正确的结果:

**误解三** **** **量子态没有能量**

初步估计是第三方库turndown的问题

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

No branches or pull requests

2 participants