Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When all tags are empty, Trumbowyg cleans content but should keep it #703

Closed
noistudio opened this issue Jan 27, 2018 · 6 comments
Closed
Labels
bug:core Bug in core (trumbowyg.js)

Comments

@noistudio
Copy link

Informations

Try to insert .
<a href="#"><i class="fa fa-facebook"></i></a> <a href="#"><i class="fa fa-twitter"></i></a> <a href="#"><i class="fa fa-instagram"></i></a> <a href="#"><i class="fa fa-behance"></i></a> <a href="#"><i class="fa fa-vk"></i></a> <a href="#"><i class="fa fa-youtube"></i></a>

After press show html.
After that return back,and you can see the editor is empty

@Alex-D
Copy link
Owner

Alex-D commented Jan 27, 2018

Yep, because there is not text. Trumbowyg think all that empty tags are not wanted and empty the editor.

@Alex-D Alex-D added the bug:core Bug in core (trumbowyg.js) label Jan 27, 2018
@forelabs
Copy link
Contributor

Maybe add an option like keepEmptyTags would be a possible solution? Because I think in the most cases the current behaviour is the wanted behaviour.

Your inserted html is part of a syntax which works for you environment, because you have font-awesome installed.

I think for a normal user it makes more sense to use images and link those images instead rely on css elements which are only present on the current page.

@Alex-D Alex-D changed the title Not working When all tags are empty, Trumbowyg cleans content but should keep it. Feb 27, 2018
@Alex-D Alex-D changed the title When all tags are empty, Trumbowyg cleans content but should keep it. When all tags are empty, Trumbowyg cleans content but should keep it Feb 27, 2018
@dfreerksen
Copy link

Where in the code are empty tags being stripped out? I need this too so I would be happy to add the keepEmptyTags option.

@nategabriel
Copy link

Where in the code are empty tags being stripped out? I need this too so I would be happy to add the keepEmptyTags option.

https://github.com/groundctrl/groundctrl/blob/ce2c7130ff1e8d39093703953106636e28aff55a/vendor/assets/javascripts/trumbowyg/trumbowyg.js#L1084

@qJake
Copy link

qJake commented Nov 19, 2018

Just wanted to say thanks for adding this - our customers often use this to add simple containers like <div class="my-custom-container"></div> and then style it with some custom CSS.

Much appreciated!

@Alex-D
Copy link
Owner

Alex-D commented Nov 19, 2018

@Alex-D Alex-D closed this as completed Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug:core Bug in core (trumbowyg.js)
Projects
None yet
Development

No branches or pull requests

6 participants