ckeditor / ckeditor4

The best enterprise-grade WYSIWYG editor. Fully customizable with countless features and plugins.
https://ckeditor.com/ckeditor-4
Other
5.79k stars 2.48k forks source link

Use custom tag as placeholder in Placeholder plugin #4992

Closed KeldJ closed 2 years ago

KeldJ commented 2 years ago

Type of report

Task

Provide description of the task

To access the placeholder in DOM using $("placeholder") I would like to replace the [[]] with a custom tag () i replaced the code in the plugin as below

//var placeholderReplaceRegex = /[[([^[]])+]]/g; var placeholderReplaceRegex = /<related>(.*?)<\/related>/g;

When doing that i can find the placeholder but when processing its stripped again

I made a hack

if (node.parent.name == 'related') text = '<related>' + text + "</related>";

Which makes the placeholder unselectable but its reproducing itselfs when changing code <related><related>text</related></related>

Other details

sculpt0r commented 2 years ago

Hi, @KeldJ

If I good understand:

All above leads you to malfunction placeholder plugin? Is that correct?

Would you like to have some config option for that plugin - that allows you to set custom template? Or, you want us to help you with the implementation?

KeldJ commented 2 years ago

Hi again

Instead of the placeholder [[]] i would like to use tags where i can put attributes like

I made a change so i just use css to make the div un editable