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

background color removed from html result #80

Closed
TerrePorter opened this issue Sep 10, 2023 · 6 comments · Fixed by #81
Closed

background color removed from html result #80

TerrePorter opened this issue Sep 10, 2023 · 6 comments · Fixed by #81
Labels
enhancement New feature or request

Comments

@TerrePorter
Copy link

Describe the bug
The option for background color does not get processed.

The delta code which generates the Problem
Example:

 10 => array:1 [
      "insert" => """
        color.
        This has a 
        """
    ]
    11 => array:2 [
      "attributes" => array:1 [
        "background" => "#a10000"
      ]
      "insert" => "background "
    ]
    12 => array:1 [
      "insert" => """
        color.
        This is a list item
        """
    ]

The expected html output the delta should produce

Example:

This line has <span style="background-color: #0047b2">background</span>color.

Expected behavior
I expect the text to have a colored background instead of being removed from the result.

Screenshots
image

Additional context

quill = new Quill('#editor', {
                        placeholder: 'Compose an epic...',
                        modules: {
                            toolbar: [
                                ['bold', 'italic', 'underline', 'link'],
                                [
                                    { color: [ "#000000", "#e60000", "#ff9900", "#ffff00", "#008a00", "#0066cc", "#9933ff", "#ffffff", "#facccc", "#ffebcc", "#ffffcc", "#cce8cc", "#cce0f5", "#ebd6ff", "#bbbbbb", "#f06666", "#ffc266", "#ffff66", "#66b966", "#66a3e0", "#c285ff", "#888888", "#a10000", "#b26b00", "#b2b200", "#006100", "#0047b2", "#6b24b2", "#444444", "#5c0000", "#663d00", "#666600", "#003700", "#002966", "#3d1466", ] },
                                    { background: [ "#000000", "#e60000", "#ff9900", "#ffff00", "#008a00", "#0066cc", "#9933ff", "#ffffff", "#facccc", "#ffebcc", "#ffffcc", "#cce8cc", "#cce0f5", "#ebd6ff", "#bbbbbb", "#f06666", "#ffc266", "#ffff66", "#66b966", "#66a3e0", "#c285ff", "#888888", "#a10000", "#b26b00", "#b2b200", "#006100", "#0047b2", "#6b24b2", "#444444", "#5c0000", "#663d00", "#666600", "#003700", "#002966", "#3d1466", ] }
                                ],
                                [{ list: 'ordered' }, { list: 'bullet' }],
                                ['clean']
                            ]
                        },
                        theme: 'snow'
                    });
@nadar
Copy link
Owner

nadar commented Sep 11, 2023

hi @TerrePorter

thanks for the report. Should not be a big deal, its mostly a copy uf https://github.com/nadar/quill-delta-parser/blob/master/src/listener/Color.php. Would you like to send a PR? Otherwise i will take care of it in the next days.

@nadar nadar added the enhancement New feature or request label Sep 11, 2023
@nadar nadar mentioned this issue Sep 11, 2023
@nadar
Copy link
Owner

nadar commented Sep 11, 2023

@TerrePorter please check #81

@TerrePorter
Copy link
Author

@nadar Yes that fixes the issue. Sorry I didn't see your other message until today. Thanks for the fix.

@nadar
Copy link
Owner

nadar commented Sep 13, 2023

Could you please try the branch quickly to see if it works as expected? You can add

"nadar/quill-delta-parser" : "dev-issue-80 as 3.3.1"

in composer.json and run composer-update to receive the code trom the given branch. Please let me know if it works as expected, so i will merge and tag a new release

@TerrePorter
Copy link
Author

Everything works perfectly. Thanks

@nadar nadar closed this as completed in #81 Sep 14, 2023
@nadar
Copy link
Owner

nadar commented Sep 14, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants