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

[Bug Report]渲染引用块中的^符号时异常 #1055

Open
2 of 3 tasks
zkd8907 opened this issue Feb 25, 2025 · 8 comments
Open
2 of 3 tasks

[Bug Report]渲染引用块中的^符号时异常 #1055

zkd8907 opened this issue Feb 25, 2025 · 8 comments
Labels
🐞bug Something isn't working pending-no-confirmed The direction of this issue has not yet been determined.

Comments

@zkd8907
Copy link

zkd8907 commented Feb 25, 2025

Prerequisites

Version

v0.8.58

Reproduction Link

No response

Describe the Bug

对于如下的内容,在cherry-markdown中渲染有异常。
内容:

> test [^a][^b][^c]

预期的效果
Image

现有的效果
Image

System Information

Contributing

Yes, I would like to submit a PR for this issue.

@zkd8907 zkd8907 added pending-no-confirmed The direction of this issue has not yet been determined. 🐞bug Something isn't working labels Feb 25, 2025
@sunsonliu
Copy link
Collaborator

Image

似乎是正常的哦,除非没有命中脚注语法,没有命中脚注语法的时候确实会命中“上标”语法哈

@zkd8907
Copy link
Author

zkd8907 commented Feb 25, 2025

Image

似乎是正常的哦,除非没有命中脚注语法,没有命中脚注语法的时候确实会命中“上标”语法哈

上角标本身是没有问题的,但是如果出现在>符号中,应该渲染为原始的字符。

@sunsonliu
Copy link
Collaborator

Image
额。。可能是策略不太一样,在Cherry这里,>引用语法也是支持所有语法的哈(比如上标、字体颜色、表格等等)

@zkd8907
Copy link
Author

zkd8907 commented Feb 25, 2025

如果是这样的话,就和现有其它的markdown引擎有差异了。我测试了多个引擎,在引用中这段字符的表现都是显示原文本😂

@sunsonliu
Copy link
Collaborator

额,有可能是上/下标 语法是一个非通用语法,其他编辑器没有支持这个语法。。如果不希望识别上下标语法的话,可以尝试加个\斜线在^的前面,比如这样:

Image

@sunsonliu
Copy link
Collaborator

如果确认不需要上/下标语法的话,可以通过配置禁用这个语法,代码如下:

var config = {
  id: 'markdown',
  value: '',
  engine: {
  	syntax: {
		// 禁用上下标语法
		sup: false,
		sub: false,
	},
  },
};
var cherry = new Cherry(config);

效果如下:
Image

@zkd8907
Copy link
Author

zkd8907 commented Feb 27, 2025

额,有可能是上/下标 语法是一个非通用语法,其他编辑器没有支持这个语法。。如果不希望识别上下标语法的话,可以尝试加个\斜线在^的前面,比如这样:

Image

😂我现在就是这么做的。是可以解决问题。

如果确认这个是符合预期的话我稍后close一下

@sunsonliu
Copy link
Collaborator

如果确认不需要上/下标语法的话,可以通过配置禁用这个语法,代码如下:

var config = {
  id: 'markdown',
  value: '',
  engine: {
  	syntax: {
		// 禁用上下标语法
		sup: false,
		sub: false,
	},
  },
};
var cherry = new Cherry(config);

效果如下: Image

嗯嗯,是设计如此哈(因为给的多,所以确实会出现不小心命中低使用频率语法的情况),如果确实不需要上下标语法,可以参考上面的回复禁用对应语法哈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞bug Something isn't working pending-no-confirmed The direction of this issue has not yet been determined.
Projects
None yet
Development

No branches or pull requests

2 participants