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

Break + Non breaking space being stripped from the post contents. #7932

Closed
diegoreymendez opened this issue Oct 9, 2017 · 17 comments
Closed

Comments

@diegoreymendez
Copy link
Contributor

diegoreymendez commented Oct 9, 2017

As reported by @rachelmcr:

iOS: Some HTML tags are removed when the post is updated

Steps to reproduce:

  1. Use the Visual 2.0 editor.
  2. Create a post and in HTML and type:
    <br>&nbsp;
  3. Update the post. The HTML disappears.

I've tested this in Calypso too, and it seems it's also stripping the content. This is leading me to believe the problem may be introduced by the code here or here, since it's logic we borrowed from the backend.

PS: while we can try to fix this in our end, we can't ensure the same logic isn't run in the backend, or in Calypso.

@catehstn
Copy link

This came up in support. Example:

<a href="https://itunes.apple.com/us/app/wordpress/id335703880?mt=8" style="display:inline-block;overflow:hidden;background:url(https://linkmaker.itunes.apple.com/assets/shared/badges/en-us/appstore-lrg.svg) no-repeat;width:135px;height:40px;background-size:contain;"></a>

Note: this also disappears in Calypso / WP Admin. I wonder if it would be covered by embed support?

@salty-horse
Copy link

The <a> tag above renders if the tag has content, such as &nbsp

@sarahblackstock
Copy link

The same user from this original report came back since they are no longer able to switch editors in the app but are still having this problem.

Hard to blog when I lose my html code between saves.

Said the issue is the same as when they originally reported it. (There are screenshots in the issue in case those would be helpful to share somewhere.)

internal ref: #222357-h

@diegoreymendez
Copy link
Contributor Author

diegoreymendez commented Jan 8, 2018

@catehstn - I believe we should discuss that one separately as there's a specific reason for that issue you're seeing.

The reason why we're losing those <a> tags is that they're empty until / unless you parse the CSS, for which we have very limited support right now.

I'd need @maxme to take a look at it from the product owner's perspective to decide if we want to extend our CSS support.

@SiobhyB
Copy link
Contributor

SiobhyB commented Jan 22, 2018

This also came up in 247417-h. In that ticket, the user provided an example of a post in that ticket. I was able to replicate the problem by copying/pasting the post to my test site in a web browser then opening it up within the app. The p tags were automatically stripped out.

@catehstn
Copy link

Agree, I don't think we need to support empty HTML tags (as neither Calypso nor WP-Admin do either).

@PatrikHax
Copy link

Why can you not just have the function where you can choose if you want HTML or not when opening the app? It worked fine for several years but has now been broken for several months now.. :)

@catehstn
Copy link

catehstn commented Mar 1, 2018

@PatrikHax We deprecated the old editor, and replaced it with a shiny new one, that is a much better experience for the vast majority of users. We're learning about quirks of the legacy editors that people relied on, and it would be helpful for us to understand what problems this change has caused for you so we can triage and address those directly, rather than supporting workarounds.

@SiobhyB
Copy link
Contributor

SiobhyB commented Mar 6, 2018

This came up again in 264972-h. The user in that tickets would prefer to see the full HTML that they've entered, rather than seeing the p tags stripped out.

@diegoreymendez
Copy link
Contributor Author

It seems a lot of different requests are popping up in this issue. Let's make sure that requests posted here refer to the issue initially reported (<p>&nbsp; being removed) (not just any tag being lost or removed).

I'll edit the title to make sure this issue is a bit less generic.

@SiobhyB - As for the P tags being removed, I agree with the user. Unfortunately the stripping is by design and will not change unless the core editor changes that behavior.

@diegoreymendez diegoreymendez changed the title Lost content. Break + Non breaking space being stripped from the post contents. Mar 6, 2018
@salty-horse
Copy link

Should a new bug be opened for empty elements being removed?

@diegoreymendez
Copy link
Contributor Author

@salty-horse - This issue's initial description doesn't really mention empty elements. The discussion that followed did. Opening a new issue would help us focus the discussion a bit more.

@AtrumGeost
Copy link

Hi folks!
I'm not sure if this issue belongs here. But a user reported that spaces between paragraphs disappear when you edit a draft in the iPad app.

I was able to replicate the issue:

  1. Create a draft on the web and add many spaces between words: http://cld.wthms.co/mdKvAP

  2. Open the same draft on the iOS app and the extra spaces are removed: http://cld.wthms.co/vuEzXe

Reported here by a user: #1261247-zen

@diegoreymendez
Copy link
Contributor Author

@AtrumGeost - Thanks for the report. At this time the effort is moving towards Gutenberg so it may be a while before we can tackle this issue.

@diegoreymendez
Copy link
Contributor Author

Small update: some of the recent issues with paragraphs being merged together will be solved by this PR: wordpress-mobile/AztecEditor-iOS#1006

@rachelmcr
Copy link
Member

We took another look at this issue, related to some recent changes and with an eye toward Gutenberg. While this is still not resolved, it may not be an issue once Gutenberg fully launches.

Gutenberg includes a spacer block to add empty space between elements — that should remove the need to use <br>&nbsp; to create empty space in posts.

@diegoreymendez
Copy link
Contributor Author

Part of this issue was fixed by wordpress-mobile/AztecEditor-iOS#1082

Non breaking spaces are no longer removed. The line breaks are a different story, but a new issue can be opened if necessary. Closing for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants