Is there a technical reason the no extension works with css classes? #1238
sugoidesune
started this conversation in
Feature Requests
Replies: 2 comments 3 replies
-
you can use classes as well. I prefer classes for styling and data attributes to pass information. |
Beta Was this translation helpful? Give feedback.
2 replies
-
For others: This is what i extend the Highlight extension with to write classes addAttributes() {
return {
value: {
default: null,
parseHTML: (element) => {
return {
value: element.getAttribute('class'),
}
},
renderHTML: (attributes) => {
if (!attributes.value) {
return {}
}
return {
class: attributes.value,
}
},
},
}
}, |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I would like to use regular CSS classes instead of data-attributes.
Is there a technical/architectural reason this isn't being used yet?
Or has it just not been done yet?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions