Microsoft/monaco-editor

Incorrectly bolding markdown

Open

#2,762 创建于 2021年11月11日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)JavaScript (1,283 fork)batch import
bughelp wantedlanguages-basic

仓库指标

Star
 (14,836 star)
PR 合并指标
 (平均合并 6小时 26分钟) (30 天内合并 15 个 PR)

描述

Currently all of the following examples get bolded by the monaco editor:

**hello**
** hello**
**hello **
** hello **

Here's how its rendered by the monaco playground:

monaco.editor.create(document.getElementById('container'), {
   value: "**hello**\n** hello**\n**hello **\n** hello **",
   language: 'markdown'
});

While only the first line should be according to the Markdown Spec and example 361 of the GitHub Flavored Markdown Spec:

To bold text, add two asterisks or underscores before and after a word or phrase. To bold the middle of a word for emphasis, add two asterisks without spaces around the letters.

It also appears that VSCode correctly applies the bolding only to the first line:

This behavior makes it confusing if using monaco to implement something like a markdown rendered, since the highlighted code will not match the rendered preview.

贡献者指南