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

使用后导致 vditor 编辑器最终渲染内容异常 #7

Open
Rikki-Zero opened this issue Feb 19, 2024 · 0 comments
Open

使用后导致 vditor 编辑器最终渲染内容异常 #7

Rikki-Zero opened this issue Feb 19, 2024 · 0 comments

Comments

@Rikki-Zero
Copy link

Rikki-Zero commented Feb 19, 2024

插件配置:
图片

没有启用插件:
图片

启用插件:
图片

无论图片使用绝对位置还是相对位置,都会触发这个异常。

测试链接:https://developer-zeng.com/archives/1706092867029

测试用markdown内容:
图片

发现:

  • 在使用标准markdown语法时,由于正常渲染出 img 标签,替换后网页行为没有异常
  • 使用 vditor 编辑器插件提供的代码块扩展语法时,会导致渲染异常

网页代码对比:

  • 阿里云盘

    • 正常:
    <div class="halo-render halo-render-wrapper drive">
      <div class="drive-info">
        <div class="platform">
          <img
            class="drive-icon"
            src="/plugins/vditor-mde/assets/static/halo-renders/icons/drive/ali.png"
            alt="ali"
          /><span>阿里云盘</span>
        </div>
        <div class="drive-title">嘶嘶</div>
      </div>
      <div class="download-info">
        <a class="btn" href="事实上" target="_blank"
          ><span class="iconfont"></span>下载资源</a
        >
        <div class="drive-password">提取码: 事实上</div>
      </div>
    </div>
    • 异常:
    <div class="halo-render halo-render-wrapper drive error">
      语法错误(不支持的平台: ali name)
    </div>
  • 内嵌相册

    • 正常:
    <div class="halo-render halo-render-wrapper gallery grid">
      <div class="title"><span class="iconfont"></span>事实上</div>
      <div class="image-list">
        <div class="vditor--gallery-container">
          <img
            class="img"
            src="https://developer-zeng.com/upload/Static/如何进行rsync增量同步%20-%20我的服务器增量同步方案.jpg"
            alt="/如何进行rsync增量同步%20-%20我的服务器增量同步方案"
          />
        </div>
      </div>
    </div>
    • 异常:
    <div class="halo-render halo-render-wrapper gallery grid">
      <div class="title">
        <span class="iconfont"></span>事实上
        ![/如何进行rsync增量同步%20-%20我的服务器增量同步方案](https://developer-zeng.com/upload/Static/如何进行rsync增量同步%20-%20我的服务器增量同步方案.jpg)
      </div>
      <div class="image-list"></div>
    </div>
  • Tips 块

    • 正常:
    <div class="halo-render halo-render-wrapper tips tips-success"><div>wdwdw</div></div>
    • 异常:
    <div class="halo-render halo-render-wrapper tips tips-success wdwdw"></div>

已经检查过本插件的代码,有几个疑问:

  • 这个插件的加载时机是什么时候?
  • 参与替换的 html 是编辑器渲染前的还是渲染后的?

如果我的理解有错误,也请指出,感谢,

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

1 participant