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

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

Open
GoogleCodeExporter opened this issue Sep 12, 2015 · 0 comments
Open

Comments

@GoogleCodeExporter
Copy link

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 [email protected] on 22 Sep 2014 at 9:28

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

No branches or pull requests

1 participant