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

Bump markdown-it-table-of-contents from 0.6.0 to 0.7.0 #159

Merged

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Sep 9, 2024

Bumps markdown-it-table-of-contents from 0.6.0 to 0.7.0.

Release notes

Sourced from markdown-it-table-of-contents's releases.

v0.7.0

  • Added: Override the container element
  • ⚠️ BREAKING CHANGE: The plugin moved from inline mode to block mode (fixes #62)
  • Changed: Updated tests, readme etc.
  • Removed: Old forceFullToc attribute

Override the container element

Two new options that accept functions that return HTML to render custom containers (and more elements if necessary):

md.use(markdownItTOC, {
    transformContainerOpen: () => {
        return '<nav class="my-toc"><button>Toggle</button><h3>Table of Contents</h3>';
    },
    transformContainerClose: () => {
        return '</nav>';
    }
});

Inline mode is now block mode

Input:

[[toc]]

Output before:

<p><div class="table-of-contents"></div></p>

Output now:

<div class="table-of-contents"></div>

The TOC now is generated in block mode, which removes the wrapping p tag. Wrapping a div in a p is considered invalid HTML.

If you really need a wrapping p-element, you can emulate the old behavior with the new container override functions:

const md = new MarkdownIt();
md.use(markdownItTOC, {
</tr></table> 

... (truncated)

Changelog

Sourced from markdown-it-table-of-contents's changelog.

[0.7.0] - 2024-09-09

  • Added: Override the container element
  • ⚠️ BREAKING CHANGE: The plugin moved from inline mode to block mode (fixes #62)
  • Removed: Old forceFullToc attribute

Override the container element

Two new options that accept functions that return HTML to render custom containers (and more elements if necessary):

md.use(markdownItTOC, {
    transformContainerOpen: () => {
        return '<nav class="my-toc"><button>Toggle</button><h3>Table of Contents</h3>';
    },
    transformContainerClose: () => {
        return '</nav>';
    }
});

Inline mode is now block mode

Input:

[[toc]]

Output before:

<p><div class="table-of-contents"></div></p>

Output now:

<div class="table-of-contents"></div>

The TOC now is generated in block mode, which removes the wrapping p tag. Wrapping a div in a p is considered invalid HTML.

If you really need a wrapping p-element, you can emulate the old behavior with the new container override functions:

const md = new MarkdownIt();
md.use(markdownItTOC, {
</tr></table> 

... (truncated)

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [markdown-it-table-of-contents](https://github.com/cmaas/markdown-it-table-of-contents) from 0.6.0 to 0.7.0.
- [Release notes](https://github.com/cmaas/markdown-it-table-of-contents/releases)
- [Changelog](https://github.com/cmaas/markdown-it-table-of-contents/blob/master/CHANGELOG.md)
- [Commits](cmaas/markdown-it-table-of-contents@v0.6.0...v0.7.0)

---
updated-dependencies:
- dependency-name: markdown-it-table-of-contents
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Sep 9, 2024
@coveralls
Copy link

Pull Request Test Coverage Report for Build 10782989097

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 91.143%

Totals Coverage Status
Change from base Build 10529029432: 0.0%
Covered Lines: 2470
Relevant Lines: 2675

💛 - Coveralls

@bcomnes bcomnes merged commit 80da11b into master Sep 10, 2024
6 checks passed
@bcomnes bcomnes deleted the dependabot/npm_and_yarn/markdown-it-table-of-contents-0.7.0 branch September 10, 2024 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants