kaoz70 / grapesjs-blocks-bootstrap4

GrapesJS Bootstrap v4 Blocks Plugin
BSD 3-Clause "New" or "Revised" License
153 stars 106 forks source link

Malformed HTML because of class_select Trait #33

Closed j2l closed 4 years ago

j2l commented 4 years ago

Hello, I'm discovering grapesJS and this plugin. I tried collapse and it seems to malform code (div ="show") and doesn't collapse:

<h1 class="display-4">Hello!
          </h1>
          <div ="show" class="collapse show">
            <p class="lead">
              <a href="" class="link"></a>This is demo content from 
              <code draggable="true">index.html</code>. For development, you shouldn&#039;t edit this file. Instead, you can copy and rename it to 
              <code draggable="true">_index.html</code>. The next time the server starts, the new file will be served, and it will be ignored by git.
            </p>
          </div>

Or maybe I'm wrong :) Please let me know

kaoz70 commented 4 years ago

Yes, you're right, the collapse is malforming the code, let me check what the problem is.

j2l commented 4 years ago

Thank you!

kaoz70 commented 4 years ago

A small update on this, the class_select trait is malforming all (or almost all) the components, its not just happening on collapse, I'm not sure is this is a bug on the trait or of GrapesJS, I'm still checking this out...

RodriAndreotti commented 4 years ago

Hey, man! First of all, Thanks for this greate module! If this information helps in any way, when selecting a class, the size of a column in relation to the grid, for example, in addition to the class inside the class attribute, a "phantom attribute" similar to this is also inserted: = "col-lg-9", maybe the trait is trying to create the class attribute again, wouldn't that be a possibility?

kaoz70 commented 4 years ago

Yes, it could be, if anyone can help me with this it would be great, I have a deadline to meet next week and cant work on any issues until then

RodriAndreotti commented 4 years ago

I don't know grapejs structure very well but if I have a little time left I will try to take a look and see if I can find some way to solve it definitively, in my case, as a palliative, I used a regex to solve it on the backend, but if I'll try to give a look too ;-)

RodriAndreotti commented 4 years ago

I believe I managed to solve the problem, if I can review the code ;-)