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

Random <p> and </p> tags in post editor pages #5

Closed
herrvigg opened this issue Jun 21, 2018 · 3 comments
Closed

Random <p> and </p> tags in post editor pages #5

herrvigg opened this issue Jun 21, 2018 · 3 comments
Labels
legacy issue Legacy issue imported from original repo

Comments

@herrvigg
Copy link
Collaborator

Issue by johnclause
Wednesday Jan 14, 2015 at 02:16 GMT
Originally opened as qTranslate-Team/qtranslate-x#5


Theme: any, "Twenty Fifteen" would do.
Plugins: can be qTranslate-X only, I do not think it is a compatibility problem with other plugins.
At least two languages, for example, en and de, to be specific.

Steps to reproduce the problem:

  • Add New Post
  • Title: any, it is not a subject of the problem
  • Put Editor in "Text" mode
  • Description: type EN for "en" language and DE for "de", just as an example, any text would do.
  • Publish.
  • Go to database and see that 'post_content' field of that post has <!--:en-->EN<!--:--><!--:de-->DE<!--:-->, which is normal.
  • Open that post for editing.
  • Editor comes in "Text" mode, as it was left in "Text" mode before.
  • Switch to "Visual" mode
  • Click on description text, do not even need to do any typing, just press "Update" button right then.
  • Database now has: <!--:en--><p>EN</p><!--:--><!--:de-->DE<!--:-->, where EN was the active language at time of pressing "Update". This part is kind of explainable, TinyMCE embraced active text with <p></p>, although it does not do so, when plugin is deactivated.

But then something really strange happens:

  • click in editor again and then “Update” again, database now has:
    <!--:en--><p>EN</p><p> </p><!--:--><!--:de-->DE<!--:-->
  • And even more striking, do not click anywhere, just press “Update” again. database now has:
    <p><!--:en--><p>EN</p><p> </p><p><!--:--><!--:de-->DE<!--:--></p>
    Pay attention that <p> and </p> do not match anymore.

Further clicking “Update” does not modify this text anymore.

I have been printing various variables on java console, but those <p> did not show up anywhere I looked so far. I have no idea how they get into the database.

If people consistently keep editor at "Visual" mode, they apparently do not notice a problem. Nobody complained about this yet, but we'd better to clear it out before somebody does.

P. S. I first discovered this in the original qTranslate, and I thought that after cleaning the code, it will go away on its own, but it did not so far.

@herrvigg herrvigg added the legacy issue Legacy issue imported from original repo label Jun 21, 2018
@herrvigg
Copy link
Collaborator Author

Comment by johnclause
Monday Jan 19, 2015 at 16:12 GMT


I see that some extra unmatched <p> tags coming after the line
$content = apply_filters( 'the_editor_content', $content ); in /wp-includes/class-wp-editor.php.

@herrvigg
Copy link
Collaborator Author

Comment by johnclause
Monday Jan 19, 2015 at 21:25 GMT


trunk now has a version 2.9.7b available for testing

@herrvigg
Copy link
Collaborator Author

Comment by johnclause
Saturday Jan 31, 2015 at 00:41 GMT


2.9.8.0 has a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy issue Legacy issue imported from original repo
Projects
None yet
Development

No branches or pull requests

1 participant