Skip to content

How do you use inline text elements eg, kbd? #483

Closed Answered by rpaul-stripe
taktran asked this question in Q&A
Discussion options

You must be logged in to vote

However, when I try it in the markdoc sandbox, kbd is an unrecognised tag

The markdoc-html-tag-schemas thing that you link is a third-party library that would have to be installed separately — Markdoc itself doesn't come with a kbd tag, so that is why it isn't recognized in the Markdoc sandbox.

I can't get the primary attribute to work.

By default, Markdoc tag attributes render out in HTML as attributes of the same name on the underlying HTML tag. In your example, the "primary" attribute in the Markdoc tag will become a literal primary="Ctrl" attribute on the kbd HTML tag in the output. In order to make an attribute's content render as the child of the node, you need to use a transfor…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@taktran
Comment options

Answer selected by taktran
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants