6174 / 6174/pagedown

"Add heading" with no selected text doesn't add heading.

未关闭
#79 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
auto-migrated Priority-Medium Type-Defect
主要语言
JavaScript
星标
0
派生
0
PR 合并指标
30 天内没有已合并 PR

描述

```
What steps will reproduce the problem?
1. Type in "balpha is awesome at "
2. Hit Ctrl-H or "Add header"

What is the expected output? What do you see instead?

balpha is awesome at ## Heading ##

(as opposed to)

balpha is awesome at

## Heading ##

What version of the product are you using? On what operating system?

Repro'd on Discourse and SE.

Please provide any additional information below.

I _think_ it would be enough to change
https://code.google.com/p/pagedown/source/browse/Markdown.Editor.js#2182 so
that chunkStart and chunkEnd also add newlines, perhaps like so:

// If we clicked the button with no selected text, we just
// make a level 2 hash header around some default text.
if (!chunk.selection) {
chunk.startTag = "\n\n## ";
chunk.selection = this.getString("headingexample");
chunk.endTag = " ##\n\n";
return;
}

(Sorry, I don't have Mercurial or Node installed right now.)
```

Original issue reported on code.google.com by `badpazzword@gmail.com` on 22 Sep 2014 at 9:28

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。