Skip to content
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

Add support to highlight single lines of code #2993

Open
bdemers opened this issue Jan 28, 2022 · 1 comment
Open

Add support to highlight single lines of code #2993

bdemers opened this issue Jan 28, 2022 · 1 comment

Comments

@bdemers
Copy link
Contributor

bdemers commented Jan 28, 2022

It would be great if we could bold/highlight single (or a range of lines) of code in our snippets in order to draw attention a specific bit of code in a block:
https://vuepress.vuejs.org/guide/markdown.html#line-highlighting-in-code-blocks

This looks like it should be possible today, but I wasn't able to get it to work locally.
I'm guessing it's related to our use of markdown-it-attrs:
https://github.com/okta/okta-developer-docs/blob/master/packages/%40okta/vuepress-site/.vuepress/config.js#L286

I tried a few things without any success:

NOTE: the Vuepress 2.x (beta) also mentioned they forked the highlight-lines plugin, so if we are planning on upgrading sometime after 2.x is released, then it's possible this could just work.

TL;DR: Highlighting, a single line (or lines) of markdown should work via something like:

```js{2-3}
console.log("dull code")
console.log("cool code")
console.log("more cool code")
console.log("other dull code")
```
@janethu-okta
Copy link
Contributor

Hi Brian,
Create a JIRA ticket for the team to look into your suggestion.
https://oktainc.atlassian.net/browse/OKTA-485123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants