-
-
Notifications
You must be signed in to change notification settings - Fork 74
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
underline links #244
underline links #244
Conversation
Thanks ! Could you please add a test ? Shouldn't be very hard. Just take a look at test/parser.spec.js. And no need to underline. Let us just keep the output simple to the eye. And also update the commit message to -
|
ping @jedahan. Any chance you could take a look ? Thanks ! |
Homepages as defined per tldr-pages/tldr#2649 (comment) are commonmark autolinks. What @jedahan did is both:
Lets puts formatting aside for a moment. This means that tldr-node-client/lib/parser.js Lines 8 to 12 in 2e7f85b
followed by code that prevents their rendering: tldr-node-client/lib/parser.js Lines 30 to 32 in 2e7f85b
after which particular (officially recognized) sections are re-enabled, like strong (bold) for example:tldr-node-client/lib/parser.js Lines 68 to 70 in 2e7f85b
I know it is highly unlikely that anyone will ever put
I hear you saying that won't ever happen except it might happen right away if there is any link inside of any currently available tldr pages. I'm not talking about homepages explicitly, there might be links used for demonstration purposes inside example description section and they will simply get swallowed because they are blacklisted by default. This brings me to the point of graceful degradation. Wonderful example of such approach is text only renderer shipped as part of marked itself (exposed as
In practical terms that means subclassing
and piping that through:
Not bad I guess? 😉 Long story short lets fix things instead of patching them Going back to question of link formatting. I don't have opinion on underline vs. plain styling but I do have objections regarding proposed homepage formatting as showcased here: > Homepage: <https://www.7-zip.org/>. Once this goes through marked we'll end up with following output:
This trailing dot is really a nice way to play let's guess what would terminal emulator do game 🙅♂️ In some terminal emulators it might be wrongly treated as part of url (especially if it ends with That being said my vote goes to render it in brackets please. 🙏 There is also this awesome new emerging standard: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda /shameless plug ahead Click to reveal 😁Example implementation can be found here: |
Honestly I don't even use the node client, and I did think it weird that the client was hiding information. |
Subclassing and customising the list of tokens sounds good to me. Regarding brackets vs angle brackets, please comment on the original issue so that other folks get to know. Thanks for looking into this. |
Closed in favor of #245 |
Added link underlining to unblock tldr-pages/tldr#2660
npm run test:all
)