k0shk0sh / FastHub

FastHub the ultimate GitHub client for Android.
GNU General Public License v3.0
5.71k stars 931 forks source link

Improvements for producing nested bold and italic formats with the Markdown editor #819

Closed Vampire closed 7 years ago

Vampire commented 7 years ago

FastHub Version: 4.0.3
Android Version: 7.1.2 (SDK: 25)
Device Information:

This is just a suggestion, so if you don't like it, just close this issue.

In Markdown you can make bold like __this__ or **this** and italic like *this* or _this_. In other systems, e. g. on StackOverflow, bold is like *this*, italic is like _this_. I guess in Markdown the bold was doubled and both chars for both, so that you can better nest the formattings.

The combination of bold and italic can be done like __*this*__ or **_this_** or *__this__* or _**this**_ or even ___this___. But in source view I personally dislike the last variant, as it is not as expressive as the other variants. And for the standalone variants I personally prefer **this** for bold and _this_ for italic as it is more consistent with other systems like StackOverflow, or even the conventions in purely text based systems like e. g. IRC. Even Skype displays *-framed words as bold, _-framed words as underlined and ~-framed words as stroke-through if you didn't disable it. And actually if you press the bold button on the GitHub site, it also uses ** by default and not __.

So here some suggestions:

I think that these changes would improve the readability of the improved Markdown code.

k0shk0sh commented 7 years ago

I don't understand what is the issue here? you are asking to change the current markdown ____ to **** which is fine, however the rest I don't really get it? why would it be the app responsibility to do things that i'm not sure the user wants? for example if you highlighted something & pressed on any markdown syntax button it will make that particular highlighted text to be for ex bold.

I'll definitely change those to follow githubs style even tho they are both valid mardown syntax.

Vampire commented 7 years ago

@k0shk0sh well, the issue are the four (actually three, as one is current behavior) points I listed above. One is to change the bold button from ____ to **** which is used in other systems and is also the version used by GitHub Markdown editor on the page.

to do things that i'm not sure the user wants? for example if you highlighted something & pressed on any markdown syntax button it will make that particular highlighted text to be for ex bold .

I don't know what you mean. If course you know what the user wants. He wants bold text or italic text, according to the button he pressed. That's just like currently, I didn't suggest to change that.

What I suggested was, to intelligently select whether to insert **** or ____ for bold and _ or * for italic, depending on the context. That way you produce more easily readable Markdown code. If you follow my described algorithm, you would e. g. produce *__this__* if the user selected __this__ and pressed the italic button, instead of ___this___, which is harder recognizable as bold-italic format.