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

I 开头的英文句子会被解析成 ol/li #31

Closed
shiny opened this issue Dec 10, 2017 · 3 comments
Closed

I 开头的英文句子会被解析成 ol/li #31

shiny opened this issue Dec 10, 2017 · 3 comments

Comments

@shiny
Copy link

shiny commented Dec 10, 2017

举例:
I was
将会被解析成

<ol><li>was</li></ol>

据我了解没有任何一个 Markdown 格式规定了这样的 list 格式?所以这是一个 bug?

@shiny
Copy link
Author

shiny commented Dec 10, 2017

if (preg_match("/^(\s*)((?:[0-9]+\.)|(?:[a-z]\.?)|\-|\+|\*)\s+/i", $line, $matches)) {

要解决这个问题,可以删除第 625 行最后一个等价于 等价于{0,1}?即可, (?:[a-z]\.?) => (?:[a-z]\.)

if (preg_match("/^(\s*)((?:[0-9]+\.)|(?:[a-z]\.)|\-|\+|\*)\s+/i", $line, $matches)) {

不知道哪个格式规定字母不加 . 也可以当做 list,如有人知道烦请告知,感谢。

@shiny
Copy link
Author

shiny commented Dec 10, 2017

如果单个英文字符+空格就能解析为 ol,那么大量英语句子会出现问题,例如:

  • A bag
  • I did it.
  • Z is the twenty-sixth and last letter of the English alphabet.
  • u know

@shiny shiny mentioned this issue Dec 10, 2017
@shiny
Copy link
Author

shiny commented Dec 10, 2017

另外,在 js 版本中也有同样的问题,在线测试:例如: I got it.

其他各个 markdown 编辑器中均无此问题。

@joyqi joyqi closed this as completed in 411de24 Dec 11, 2017
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