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

Is there a way to make this work with markdown-it-attrs or markdown-it-decorate? #4

Open
shiling opened this issue Oct 17, 2018 · 0 comments

Comments

@shiling
Copy link

shiling commented Oct 17, 2018

I need to set some classes and ids on the code fences, and I've used markdown-it-attrs and markdown-it-decorate to do so. However, when combined with this markdown-it-highlight-lines, markdown-it-attrs and markdown-it-decorate doesn't work anymore, wondering if there's a way to get them to work together?

Here's an example of how I'm using markdown-it-highlight-lines and markdown-it-decorate together:

``` {1}
// Highlight this line
// More code
```
<!-- {code: #example-1} -->

This should generate

<pre>
   <code id="example-1">
      <span class="highlighted-line">// Highlight this line</span>
      // More code
   </code>
</pre>

For now, it looks like I need to find another workaround, that is to wrap the code fence in a

container and add the class and ids to that instead of to the code itself. Haven't tried it yet, but I'm wondering if I'm doing something wrong here.

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

1 participant