tinymce-rails icon indicating copy to clipboard operation
tinymce-rails copied to clipboard

Is there anyway to apply toolbar event apply only to the root node of the selection

Open fs-td-eitaro-ueda opened this issue 5 years ago • 0 comments

Hi, I am using tinymce-rails (4.6.7).

I was wondering if the tinymce toolbar to only act on the root node of the selected element (highlighted by cursor).

Original selected elements:

<div>
    <table>
        <tbody>
            <tr>
                <td>
                    <div>some text here</div>
                </td>
            </tr>
        </tbody>
    </table>
</div>

Tinymce by default when used "bold" button on the toolbar:

<div>
    <table>
        <tbody>
            <tr>
                <td>
                    <strong>
                        <div>some text here</div>
                    </strong>
                </td>
            </tr>
        </tbody>
    </table>
</div>

Instead, I want it to be like below where the style is applied to the top element:

<div font-weight="bold">
    <table>
        <tbody>
            <tr>
                <td>
                    <div>some text here</div>
                </td>
            </tr>
        </tbody>
    </table>
</div>

Please let me know if anyone knows a solution to this.

fs-td-eitaro-ueda avatar Feb 10 '20 14:02 fs-td-eitaro-ueda