Skip to content

fix: 修复对话中表格中图片时出现错位 #1561 #1569

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

Merged
merged 1 commit into from
Nov 7, 2024

Conversation

shaohuzhang1
Copy link
Contributor

fix: 修复对话中表格中图片时出现错位 #1561

Copy link

f2c-ci-robot bot commented Nov 7, 2024

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link

f2c-ci-robot bot commented Nov 7, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@shaohuzhang1 shaohuzhang1 merged commit 8a0c204 into main Nov 7, 2024
4 checks passed
@shaohuzhang1 shaohuzhang1 deleted the pr@main@fix_chat_table_img branch November 7, 2024 07:37
}
})
return result
}
const split_quick_question = (result: Array<string>) => {
return result
.map((item) => split_quick_question_(item))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

代码中有一些问题:

  1. 多个空格可能导致错误或格式化的混乱,请确保在生成输出前进行适当处理。
  2. split_md_img 函数中的参数类型为 "Array" 而非数字;可以修改为字符串数组(使用 string[] 类型)以避免潜在的值范围异常。同时,对于一些特殊字符(如 [ ]),需要统一转换为 HTML 缩写格式。
  3. 有关 markdownItConfig(md) 的配置,可以在渲染过程中动态地设置其属性。

总的来说,可以通过更严格的数据结构和方法来提高效率,并尽量减少不必要的中间层次和复杂的函数调用。例如,在某些情况下可以直接替换模板块,而不是多次遍历每个区块。这将有助于保持代码简洁且易于理解。

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

Successfully merging this pull request may close these issues.

2 participants