- Notifications
You must be signed in to change notification settings - Fork1.1k
Added support for HTML className for Block objects#791
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
tbcooney commentedJun 2, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
If this is going to be eventually supported I would love to see this extended to |
ghost commentedJul 9, 2020
Awesome work@SergeyBurtsev! This will make adding classes to block objects way easier. |
SergeyBurtsev commentedJul 10, 2020 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Thank you@clarkcode ! Maybe I did this patch too hastly without discussing with anyone here and only then realized that it can violate Trix philisophy and long-term plans. I am less professional than others here, so I am not surprised if I missed the point :) |
vitality82 commentedOct 8, 2020
When will this be resolved? I been thinking all the time that TRIX can be extended with custom toolbar items, but apparently there's no way I can extend it to support a block level element like "textAlign: center" in a clean way without className support. This is a dealbreaker since I have to support existing rich text content and I've lost a fair amount of time on researching this. I'm very happy with TRIX but can you please give an update on this matter? |
mguidetti commentedNov 8, 2020
Hoping there's some movement on merging this soon as well. I need to wrap some text in a div with a class in a project I'm working on. Is there any workaround for this currently until this is merged? |
davissp14 commentedNov 25, 2020
Any updates on this? |
Shelob9 commentedFeb 9, 2021
I am currently attempting to impliment mentions in a Trix editor. I am attempting to do something like |
richlarcombe commentedFeb 20, 2021
@SergeyBurtsev was hoping you might be able to help advise. |
SergeyBurtsev commentedFeb 22, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@richlarcombe I've refactored the fork, so now it should work the way you suggested. |
richlarcombe commentedFeb 25, 2021 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@SergeyBurtsev, this is a great help, many thanks. |
richlarcombe commentedFeb 25, 2021
@SergeyBurtsev actually after further testing have found that this issue only occurs for multiple strings in the class field. |
SergeyBurtsev commentedFeb 27, 2021
@richlarcombe You are right about multiple classes. I've updated the HTMLParser, so it now compares full className string of the element, so you could use it like: But I still don't know if this addon is valuable for the core Trix editor. Maybe I should close this PR and implement it as a separate patch, which can by applied over the official release if needed. |
richlarcombe commentedMar 2, 2021
@SergeyBurtsev thanks for that, works great. |
petebytes commentedMar 16, 2021
@SergeyBurtsev I would donate towards this patch. |
artisr commentedJun 16, 2021
@SergeyBurtsev thank you for this! :) |
Mth0158 commentedFeb 27, 2022
Is this ever be implemented? It would be such a game-breaker feature for Trix usage...@dhh |
Eric-Guo commentedMar 6, 2022
@Mth0158 I already publishedadding this PR custom trix version, including the align center and right button in toolbar also, you cancheck the code if you having my similar requirement. |
This PR allows to use HTML class attribute (className) for Block level objects and that allows to add extended functionality like text alignment adding and toggling those classes for the nearest block object.