WYSIWYG when insert html the head and meta not save

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Riad
    Member
    • Aug 2018
    • 31

    WYSIWYG when insert html the head and meta not save

    Hi, Everybody. WYSIWYG when insert html the head and meta not save. Only save the body. Thank you in advance
  • shalmaxb
    Senior Member
    • Mar 2015
    • 1602

    #2
    Hi, I think, there is no solution. The editor strips a lot of Tags and Code. See here: https://forum.espocrm.com/forum/gene...ustom-template

    Comment


    • Riad
      Riad commented
      Editing a comment
      Thank you very much
  • esforim
    Active Community Member
    • Jan 2020
    • 2204

    #3
    Supposedly CKEditor work quite well with EspoCRM, so you can give that a try when you do editing.

    Personally I test out to create a template, and in term of function the online editor provide it is still quite limited so I stopped playing with it, maybe the installation version is better I don't know

    Here is an online editor: https://onlinehtmleditor.dev/
    And if you want to install it yourself:https://ckeditor.com/ckeditor-5/

    I played with CKEditor for about 25 minutes so I might have missed out on what it can truly do.

    Comment

    • emillod
      Active Community Member
      • Apr 2017
      • 1405

      #4
      In the past i was working with my partner on adjusting wysiwyg editor. And there is a parameter which is responsible for removing tags. I can't remember where it was unfortunatelly

      Comment

      • shalmaxb
        Senior Member
        • Mar 2015
        • 1602

        #5
        emillod and @Riad,

        I did a bit searching and based on the last post I found the place, where the HTML is stripped out.

        Go to

        client/lib/summernote.min.js

        find two instances of

        Code:
        prettifyHTML
        Delete them. After that the editor does not strip anything anymore.

        I did not yet test that thoroughly, so I don`t know, if it could affect in any negative way at any moment. Unfortunately there does not seem to be a possibility to set that function to false/true anywhere.
        As well it might not be update safe.

        Anybody could confirm, that tis will not be damaging anything? I am not skilled in Javascript.

        Edit: testing further, it still strips HTML header tags
        Last edited by shalmaxb; 08-31-2021, 08:57 AM.

        Comment

        • shalmaxb
          Senior Member
          • Mar 2015
          • 1602

          #6
          From my searching, I guess we could solve that problem by integrating codemirror in summernote. But as already written I do not have the skills for that. Anybody could help with that?

          Comment

          • Riad
            Member
            • Aug 2018
            • 31

            #7
            Thank you all for your responding @shalmaxb @emillod @espcrm

            Comment

            • johnmakoa
              Junior Member
              • Sep 2021
              • 1

              #8
              The problem is with the WYSIWYG renderer as mentioned. The out of the box config for magento is set when saving, to reset the page view back to the WYSIWYG view and that's when your code gets rewritten.

              A real nasty hack is to disable the render or set it to default to html in the config menu.

              Comment

              Working...