pioul / Minimalist-Online-Markdown-Editor

This is the simplest and slickest online Markdown editor.
http://markdown.pioul.fr
MIT License
265 stars 45 forks source link

Integration of ace editor #2

Closed ztec closed 10 years ago

ztec commented 10 years ago

Hello, I changed the simple textarea by ace editor in order to be able to use tabulation and ehnace text typing.

philippe-git commented 10 years ago

Hey, thanks for forking this project!

Unfortunately, while syntax highlighting is a nice thing to have, it breaks spell-checking. Additionally, and as John Gruber puts it, "Markdown is intended to be as easy-to-read and easy-to-write as is feasible". So I'd argue syntax highlighting isn't necessary (even if comfortable), even more considering the preview panel on the right.

As for the tab key handling, I can't think of anything that'd require it for writing text. (Except writing code, of course, but since this editor is intended to be minimalist, I'd expect programmers to write code in their preferred editor/IDE and paste it afterward.) Did you have something else than code in mind when adding that feature?

For these reasons, I won't be merging that PR, but please feel free to request other pulls if you have additional ideas to enhance the editor. Thanks again!

ztec commented 10 years ago

OK, I understand. May I make a pull request with just the tab management ? with no syntax highlighting. In my opinion, the tab is part of the markDown specification, it should be usable with no Copy/past ;-)

philippe-git commented 10 years ago

If a tab can spare a couple of spaces, then yes, of course!

Before requesting a pull of the same commit though, please don't forget to cache the variables retrieved from the DOM and that are being used multiple times (I'm thinking of editor.markdownSource.val()).

Also, this is already referencing the textarea element in the context of that function, so there's no need for editor.markdownSource.get(0).

philippe-git commented 10 years ago

I went ahead and added tab support: ddd7aa0506cec37130930e63589ee228adfcb614