ttscoff / mdless

MIT License
866 stars 39 forks source link

Feature Request: Please add the feature of Bold and Strikthrough rendering of text #78

Open prateekamana opened 2 years ago

prateekamana commented 2 years ago

image

ttscoff commented 2 years ago

Bold should already get a different color if your theme is set up properly. Not all terminals can support bold fonts, so it doesn’t attempt to do that. I’m not sure how you’d expect strikethrough to render.

Thanks, Brett On Apr 12, 2022, 3:35 AM -0500, Prateek @.***>, wrote:

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

prateekamana commented 2 years ago

Thanks for the response Brett, I just found Glow markdown reader today https://github.com/charmbracelet/glow And it achieves both strikethrough and bold somehow, I'm not smart enough to figure out how it exactly works or else I'd contribute, but it could be a cool feature right?

ttscoff commented 2 years ago

Interesting. Yeah, that could be cool, might have to deconstruct to see how it's done. There might an ANSI escape code for strikethrough I'm forgetting about…

FYI, though, I tested bold text in mdless and in my terminal it showed with bright white and bold. In addition to your terminal and theme settings, it could also be affected by your terminal color settings (whether bright is supported) and the font you use (whether bold is supported).

On 12 Apr 2022, at 7:44, Prateek wrote:

Thanks for the response Brett, I just found Glow markdown reader today https://github.com/charmbracelet/glow And it achieves both strikethrough and bold somehow, I'm not smart enough to figure out how it exactly works or else I'd contribute, but it could be a cool feature right?

-- Reply to this email directly or view it on GitHub: https://github.com/ttscoff/mdless/issues/78#issuecomment-1096679372 You are receiving this because you commented.

Message ID: @.***>

ttscoff commented 2 years ago

Oh, and now I'm looking at your screenshot and realizing it's not parsing that at all. Is there a hard line break in the middle of the bolded text? It's not designed to parse multi-line bold text.

On 12 Apr 2022, at 3:35, Prateek wrote:

image

-- Reply to this email directly or view it on GitHub: https://github.com/ttscoff/mdless/issues/78 You are receiving this because you are subscribed to this thread.

Message ID: @.***>

prateekamana commented 2 years ago

My md :

# TOHAPPEN [12-04-2022]

1. ~~Fix the tooltip bug no matter what. Try not to procrastinate until necessary~~
2. ~~Get FL Studio on Linux working and investigate the prospects of music production on linux~~
3. ❌ Make sense of Search Like Me with Bhavesh's Changes
> Couldn't do because I got tired by the end of the day and crashed early

Glow output : image

mdless output : image

ttscoff commented 2 years ago

Right, I don't expect any of the strikethrough text to render at this point as the syntax isn't recognized by mdless. I'm just trying to figure out why the ** text in your original screenshot isn't rendering.

-Brett

On 13 Apr 2022, at 4:19, Prateek wrote:

My md :

# TOHAPPEN [12-04-2022]

1. ~~Fix the tooltip bug no matter what. Try not to procrastinate 
until necessary~~
2. ~~Get FL Studio on Linux working and investigate the prospects of 
music production on linux~~
3. ❌ Make sense of Search Like Me with Bhavesh's Changes
> Couldn't do because I got tired by the end of the day and crashed 
> early

Glow output : image

mdless output : image

Please ignore the indentations and whitespace messups, they must just be because of terminal resizing that I did.

-- Reply to this email directly or view it on GitHub: https://github.com/ttscoff/mdless/issues/78#issuecomment-1097779173 You are receiving this because you commented.

Message ID: @.***>

prateekamana commented 2 years ago

Ah, I'm sorry I forgot my example doesn't have a bold text.

# TOHAPPEN [14-04-2022]
1. **Solve the trigger issue ASAP**
2. Make sense of Search Like Me with Bhavesh's Changes
3. Make a finger drumming plan
4. Make a piano learning plan

mdless: image

ttscoff commented 2 years ago

Huh, apparently it's not parsing bold within a list item. Will have to dig into that. It works fine outside in a paragraph or block quote.

-Brett

On 14 Apr 2022, at 5:27, Prateek wrote:

Ah, I'm sorry I forgot my example doesn't have a bold text.

# TOHAPPEN [14-04-2022]
1. **Solve the trigger issue ASAP**
2. Make sense of Search Like Me with Bhavesh's Changes
3. Make a finger drumming plan
4. Make a piano learning plan

mdless: image

-- Reply to this email directly or view it on GitHub: https://github.com/ttscoff/mdless/issues/78#issuecomment-1099030605 You are receiving this because you commented.

Message ID: @.***>

jsclary commented 1 year ago

FYI, it may not be related but bold, italic and bold-italic also have a more general issue in that they seem to require newline, whitespace or punctuation before the open and after the close so it doesn't properly render legal markdown like ***x***inu ***i***s ***n***ot ***u***nix xinu is not unix

ttscoff commented 1 year ago

Because mdless doesn't have a fully tokenized parser, detecting emphasis in the middle of a word is problematic because something like file_name or any_underscored_word causes errors, especially when the emphasis marker isn't paired. mdless is designed to be a convenience for quickly viewing Markdown files, not necessarily a fully fledged Markdown engine.

-Brett

On 9 Dec 2022, at 12:35, Jason S. Clary wrote:

FYI, it may not be related but bold, italic and bold-italic also have a more general issue in that they seem to require newlline, whitespace or punctuation before the open and after the close so it doesn't properly render legal markdown like ***x***inu ***i***s ***n***ot ***u***nix xinu is not unix

-- Reply to this email directly or view it on GitHub: https://github.com/ttscoff/mdless/issues/78#issuecomment-1344632849 You are receiving this because you commented.

Message ID: @.***>