C1editor changes class name in tag

Posted by: haim on 12 January 2020, 1:25 am EST

    • Post Options:
    • Link

    Posted 12 January 2020, 1:25 am EST

    I am trying to use C1editor in a winform as an html editor. I would like to load a template and allow the user to edit it. In general the editor does what I want except that some tags are altered when uploaded to the editor. Specifically I have the following tag in my template:

    <h1 class="title object-non-visible animated object-visible fadeIn" data-effect-delay="100" data-animation-effect="fadeIn">My Title</h1>
    

    It gets ‘converted’ to

    <h1 class="title object-non-visible">My Title</h1>
    

    When its loaded into the control. Is there some way to avoid this behavior?

    I’m working around it by rewriting the tag before its saved but I don’t know if other tags are messed up also.

    Haim Katz

  • Posted 12 January 2020, 10:36 pm EST

    Hello Haim Katz,

    In order to solve the problem at your end we need a stripped down sample of your project replicating the issue to get what you are doing exactly.

    Regards,

    Prabhat Sharma.

  • Posted 19 January 2020, 6:29 pm EST

    If you load the file below into the C1Editor either by using the open file button in the toolbar or through code it converts line 20:

    <h2 class="title object-non-visible" data-animation-effect="fadeIn" data-effect-delay="100"><strong>Project</strong> Title</h2>
    

    to

      <h2 class="title object-non-visible"><strong>Project</strong> Title</h2>
    
    
  • Posted 20 January 2020, 11:03 pm EST

    Hello,

    This happens because of the following errors :

    The ‘data-animation-effect’ attribute is not declared.

    The ‘data-effect-delay’ attribute is not declared.

    C1Editor fixes the issue automatically that is why you are getting updated code.

    Regards,

    Prabhat Sharma.

  • Posted 25 January 2020, 5:59 pm EST

    Where and why does it need to be declared? If I add references to all the css files will it be fixed?

  • Posted 27 January 2020, 12:41 am EST

    Hello Haim,

    As per you given code it seems that you want to put some custom style to the text.

    You can look at the product sample “CustomTags” for help. This sample is located at : \Documents\ComponentOne Samples\WinForms\v4.0\C1Editor\CS\CustomTags



    If this does not help then please share a small sample including the required css files so that we can help you in a better way.

    Regards,

    Prabhat Sharma

  • Posted 28 January 2020, 1:34 am EST

    Hello Prabhat,

    If I follow this example I would need to define every class or combination of classes I have in the file. How are css files handled? The editor does not appear to relate to css references in the header. Can I only associated one css file through the code? Will the css file preclude the need to define every class combination in an xml extension.

    Haim

  • Posted 28 January 2020, 9:59 pm EST

    Hello Haim,

    You can look at the sample “UserCSS” in the product sample to learn how you can use or create your own CSS. This sample is located at :

    …\Documents\ComponentOne Samples\WinForms\v4.0\C1Editor\CS\UserCSS



    You can go through the following link to learn how you can use CSS with C1Editor :

    https://www.grapecity.com/componentone/docs/win/online-richtexteditor/usingacascadingstyle.html

    Regards,

    Prabhat Sharma.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels