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

Classname merge is glitched #22

Closed
4 tasks done
gustaveWPM opened this issue Nov 4, 2023 · 2 comments
Closed
4 tasks done

Classname merge is glitched #22

gustaveWPM opened this issue Nov 4, 2023 · 2 comments
Labels
🙋 no/question This does not need any changes 👎 phase/no Post cannot or will not be acted on

Comments

@gustaveWPM
Copy link

gustaveWPM commented Nov 4, 2023

Initial checklist

Affected packages and versions

7.0.0

Link to runnable example

No response

Steps to reproduce

        rehypeAutolinkHeadings,
        {
          behavior: 'prepend',
          properties: {
            class: 'autolink-header mr-2',
            ariaHidden: false,
            tabIndex: 0
          },
          content: [
            h('span.sr-only', 'permalink'),
            s(
              'svg.autolink-svg.m-auto.h-full.mr-2',
              {
                xmlns: 'http://www.w3.org/2000/svg',
                width: 24,
                height: 24,
                fill: 'currentColor',
                viewBox: '0 0 24 24'
              },
              s('path', {
                d: 'M9.199 13.599a5.99 5.99 0 0 0 3.949 2.345 5.987 5.987 0 0 0 5.105-1.702l2.995-2.994a5.992 5.992 0 0 0 1.695-4.285 5.976 5.976 0 0 0-1.831-4.211 5.99 5.99 0 0 0-6.431-1.242 6.003 6.003 0 0 0-1.905 1.24l-1.731 1.721a.999.999 0 1 0 1.41 1.418l1.709-1.699a3.985 3.985 0 0 1 2.761-1.123 3.975 3.975 0 0 1 2.799 1.122 3.997 3.997 0 0 1 .111 5.644l-3.005 3.006a3.982 3.982 0 0 1-3.395 1.126 3.987 3.987 0 0 1-2.632-1.563A1 1 0 0 0 9.201 13.6zm5.602-3.198a5.99 5.99 0 0 0-3.949-2.345 5.987 5.987 0 0 0-5.105 1.702l-2.995 2.994a5.992 5.992 0 0 0-1.695 4.285 5.976 5.976 0 0 0 1.831 4.211 5.99 5.99 0 0 0 6.431 1.242 6.003 6.003 0 0 0 1.905-1.24l1.723-1.723a.999.999 0 1 0-1.414-1.414L9.836 19.81a3.985 3.985 0 0 1-2.761 1.123 3.975 3.975 0 0 1-2.799-1.122 3.997 3.997 0 0 1-.111-5.644l3.005-3.006a3.982 3.982 0 0 1 3.395-1.126 3.987 3.987 0 0 1 2.632 1.563 1 1 0 0 0 1.602-1.198z'
              })
            )
          ]

Expected behavior

cn('autolink-svg m-auto h-full mr-2', 'autolink-header mr-2')

(More infos: https://www.youtube.com/watch?v=re2JFITR7TI)

Actual behavior

'autolink-svg m-auto h-full mr-2' + ' ' + 'autolink-header mr-2'

(This results in a conflict: both m-auto and mr-2 are in the classList.)

Runtime

Node v17

Package manager

yarn 1

OS

Linux

Build and bundle tools

Next.js

@github-actions github-actions bot added 👋 phase/new Post is being triaged automatically 🤞 phase/open Post is being triaged manually and removed 👋 phase/new Post is being triaged automatically labels Nov 4, 2023
@wooorm
Copy link
Member

wooorm commented Nov 4, 2023

It’s className: ['autolink-header', 'mr-2']; more info on properties here: https://github.com/syntax-tree/hast#properties

@wooorm wooorm closed this as completed Nov 4, 2023
@wooorm wooorm added the 🙋 no/question This does not need any changes label Nov 4, 2023

This comment has been minimized.

@github-actions github-actions bot added 👎 phase/no Post cannot or will not be acted on and removed 🤞 phase/open Post is being triaged manually labels Nov 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🙋 no/question This does not need any changes 👎 phase/no Post cannot or will not be acted on
Development

No branches or pull requests

2 participants