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

Not Work?? #2

Open
bcz3 opened this issue Sep 27, 2024 · 1 comment
Open

Not Work?? #2

bcz3 opened this issue Sep 27, 2024 · 1 comment

Comments

@bcz3
Copy link

bcz3 commented Sep 27, 2024

I just tested it and doesn't work

@X7md
Copy link
Collaborator

X7md commented Oct 4, 2024

Sorry, but I do not maintain this lib for a long time...

I suggest you to combine those libraries to do the same functionality:

  • rehype-rewrite
 {
          rewrite: (node, index, parent) => {
            if(node.tagName == "img") {
              parent.children = [...parent.children, {
                type: 'element',
                tagName: "figcaption",
                // Optional
                properties: {
                  class: "text-xs"
                },
                children: [
                  {
                    type: "element",
                    tagName: "small",
                    children: [
                      {type: 'text', value: node.properties.alt}
                    ]
                  }
                ]
              }]
            }
          }
        }
  • rehype-wrap-all
{
    selector: 'img',
    wrapper: 'figure data-img .text-center'
}
  • remark-unwrap-images (optional)

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