Skip to content

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github May 1, 2024

Bumps @astrojs/markdown-remark from 4.3.2 to 5.1.0.

Release notes

Sourced from @​astrojs/markdown-remark's releases.

@​astrojs/markdown-remark@​5.1.0

Minor Changes

  • #10538 ccafa8d230f65c9302421a0ce0a0adc5824bfd55 Thanks @​604qgc! - Adds a data-language attribute on the rendered pre elements to expose the highlighted syntax language.

    For example, the following Markdown code block will expose data-language="python":

    \```python
    def func():
        print('Hello Astro!')
    \```
    

    This allows retrieving the language in a rehype plugin from node.properties.dataLanguage by accessing the <pre> element using { tagName: "pre" }:

    // myRehypePre.js
    import { visit } from "unist-util-visit";
    export default function myRehypePre() {
      return (tree) => {
        visit(tree, { tagName: "pre" }, (node) => {
          const lang = node.properties.dataLanguage;
          [...]
        });
      };
    }

    Note: The <pre> element is not exposed when using Astro's <Code /> component which outputs flattened HTML.

    The data-language attribute may also be used in css rules:

    pre::before {
      content: attr(data-language);
    }
    pre[data-language='javascript'] {
    font-size: 2rem;
    }

Patch Changes

@​astrojs/markdown-remark@​5.0.0

Major Changes

... (truncated)

Changelog

Sourced from @​astrojs/markdown-remark's changelog.

5.1.0

Minor Changes

  • #10538 ccafa8d230f65c9302421a0ce0a0adc5824bfd55 Thanks @​604qgc! - Adds a data-language attribute on the rendered pre elements to expose the highlighted syntax language.

    For example, the following Markdown code block will expose data-language="python":

    \```python
    def func():
        print('Hello Astro!')
    \```
    

    This allows retrieving the language in a rehype plugin from node.properties.dataLanguage by accessing the <pre> element using { tagName: "pre" }:

    // myRehypePre.js
    import { visit } from "unist-util-visit";
    export default function myRehypePre() {
      return (tree) => {
        visit(tree, { tagName: "pre" }, (node) => {
          const lang = node.properties.dataLanguage;
          [...]
        });
      };
    }

    Note: The <pre> element is not exposed when using Astro's <Code /> component which outputs flattened HTML.

    The data-language attribute may also be used in css rules:

    pre::before {
      content: attr(data-language);
    }
    pre[data-language='javascript'] {
    font-size: 2rem;
    }

Patch Changes

5.0.0

... (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 [@astrojs/markdown-remark](https://github.com/withastro/astro/tree/HEAD/packages/markdown/remark) from 4.3.2 to 5.1.0.
- [Release notes](https://github.com/withastro/astro/releases)
- [Changelog](https://github.com/withastro/astro/blob/main/packages/markdown/remark/CHANGELOG.md)
- [Commits](https://github.com/withastro/astro/commits/@astrojs/[email protected]/packages/markdown/remark)

---
updated-dependencies:
- dependency-name: "@astrojs/markdown-remark"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels May 1, 2024
@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Jul 1, 2024

Superseded by #50.

@dependabot dependabot bot closed this Jul 1, 2024
@dependabot dependabot bot deleted the dependabot/npm_and_yarn/astrojs/markdown-remark-5.1.0 branch July 1, 2024 20:11
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.

1 participant