-
Notifications
You must be signed in to change notification settings - Fork 449
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
Consider adding HTML kbd styles #269
Comments
How do you add HTML to Livebook today? I thought we discarded all HTML in markdown cells? |
If you save the notebook to disk, does it preserve the HTML tags? What if you close the session and reopen it from file? Or maybe I am misremembering. |
Awesome, thanks. So I am probably misremembering. Let's see what @jonatanklosko has to say on our official stance for HTML tags in Markdown. |
We actually keep the HTML and on the client we sanitize it when rendering, so that any script-like stuff is deactivated. The problem with iex> EarmarkParser.as_ast("<kbd>Ctrl</kbd>+<kbd>A</kbd>")
{:ok, [{"kbd", [], ["Ctrl"], %{verbatim: true}}], []} |
Looks like it's a bug in |
Cool, so we should probably add the styles for |
Sounds good! Actually I've just realised that this problem is only noticeable if the text starts with an opening HTML tag. When the tags are in the middle of the text, then it's all parsed as a regular paragraph: iex> EarmarkParser.as_ast("You can use a kbydingin like <kbd>Ctrl</kbd>+<kbd>A</kbd>")
{:ok,
[{"p", [], ["You can use a kbydingin like <kbd>Ctrl</kbd>+<kbd>A</kbd>"], %{}}],
[]} When using such inline decorators, it's usually in the middle of the text, so realistically it's not much of a problem. I've just opened an issue regarding the edge case (RobertDober/earmark_parser#39). Please let me know if you have any comments on the styling :) |
What do you think about setting also |
Looks good for me. |
Cool, added in eea546d :) |
I have few use cases for mentioning keyboard shortcuts, for example:
Unfortunately currently in
LiveBook
there is no difference between them and rest of text. Of coursemarkdown
would be helpful here, but a different look may took attention of the reader which is important in such use case.I would like to have some simple, but nice looking styles like on this site:
https://auth0.github.io/kbd/
Github
also have a custom look for it, see: Ctrl+A. For more information take a look at HTML TAGS.Since it's only about few simple
CSS
rules I believe it could be added in no time. Looking forward for your opinion.The text was updated successfully, but these errors were encountered: