OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.42k stars 2.39k forks source link

problem in trumbowyg-editor "convert all tag <div> to tag <p>" after edit #7027

Open VahidFPA opened 4 years ago

VahidFPA commented 4 years ago

hi After editing the footer widget that uses the editor, all "<div>" tags are converted to "<p>" tags. In the HTML Editor, click the HTML Display button and click Prove again. All Tags Change

Before clicking: image image

after clicking: image Changed all my "<div>" tags that I had class css

sebastienros commented 4 years ago

Have you checked if there is an option or a plugin to disable this conversion? If so there is a Trumbowyg editor where you can configure the plugins and the default options. You can select it in the Field's settings.

agriffard commented 4 years ago

https://alex-d.github.io/Trumbowyg/documentation/#semantic

Flarescape commented 4 years ago

Run into the same problem while starting with OC. Back then I solved it with the solution Antoine Griffard provided the link for.

If you want to write plain html, you should consider using the LiquidPart, or create your own FlowPart layout system with e.g. a Container, Row and Column widget as I did and create the templates with the matching Bootstrap HTML. With that you don't have to write Bootstrap HTML structs all the time.

arpit1188 commented 1 year ago

Greetings all,

I had tried this Text editor and ran into same issue, I tried to solve it by using following code:

Trumbowyg.prototype = { DEFAULT_SEMANTIC_MAP: { 'b': 'strong', 'i': 'em', 's': 'del', 'strike': 'del', 'div': 'p' }}

( 'div': 'p' remove this attribute from you .js file.)

Try to find this keyword in your JS file "DEFAULT_SEMANTIC_MAP"

Let me know if that helps you.

thanks & regards