• Resolved tgiokdi

    (@tgiokdi)


    Example link:
    https://www.myconfinedspace.com/2015/06/04/sentry-vs-galactus/

    contents of post when loaded with classic editor:

    <a title="sentry vs galactus.jpg" href="https://www.imgderp.com/2015/06/sentry-vs-galactus-2/sentry-vs-galactus-jpg/"><img "300" "150" src="https://www.imgderp.com/wp-content/uploads/sites/41/2014/12/sentry-vs-galactus-300x150.jpg" class="attachment-medium" alt="sentry vs galactus 300x150 sentry vs galactus" title="sentry vs galactus" /></a>
    
    from <a href="https://www.imgderp.com/2015/06/sentry-vs-galactus-2/">ImgDerp</a>

    You’ll notice the image link is completely broken when loaded with the “classic editor”. Here’s what I see when I look directly at the database:

    <p><a href="https://www.imgderp.com/2015/06/sentry-vs-galactus-2/sentry-vs-galactus-jpg/" title="sentry vs galactus.jpg"><img  "300"  "150" src="https://www.imgderp.com/wp-content/uploads/sites/41/2014/12/sentry-vs-galactus-300x150.jpg" class="attachment-medium" alt="sentry vs galactus 300x150 sentry vs galactus" title="sentry vs galactus" /></a></p>
    <br /><br />
    from <a href="https://www.imgderp.com/2015/06/sentry-vs-galactus-2/">ImgDerp</a>

    using sql query of
    SELECT post_content FROMwp_postsWHERE id = POSTID

    Is this a known issue? I’m sure it’s because of the random 300/150 but why is it converting the tags from actual tags into LT and GT? why is it not ignoring the number values?

Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter tgiokdi

    (@tgiokdi)

    Hilariously the wordpress support forums are converting the broken tags into ones that look right. the “when classic editor” portion should be showing &gt and &lt for the image tags.

    even the support forums aren’t working correctly now, lol

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Garbage in, garbage out? The classic editor is doing the same thing it did before the update, which is to try to make sense out of whatever is in your database. If it’s wrong in the database, then it’s going to come out wrong on the other end too. No editor can make sense of broken crazy.

    Best to fix the actual data in the database to be somewhat sane first.

    Thread Starter tgiokdi

    (@tgiokdi)

    I would agree, but the content displays fine on the front end until I load it up with the new classical editor, edit nothing, then hit save. after that point it’s a broken image or video embed.

    To me that suggests that something is not working as intended with how it’s loading the content.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    If the data is wrong, then the classic editor will mess it up. But it did that before, that’s not new.

    Anytime you load something into the “Visual” editor, it’s going to try to parse it and make it normalized. It was never very good at that to begin with. The “text” editor would leave it alone, but the instant you load something into the Visual editor, then yes, it will screw around with it.

    There is no fix for this, not really. You have to make the content normal to start with. Those bad entries in the img tag, the P tags, those are not normal in an old-style post. Not the new nor the old editor will be able to properly parse that. It may display okay because browsers are forgiving, but the editors are not that forgiving.

    This type of problem is not new. It’s not new to 5.0, it’s not new to the Block editor, and it is most definitely not new to the “Classic Editor”. You will get the same results in any version of TinyMCE going back 10 years. Load garbage and broken HTML into the Visual editor and it will mangle the heck out of it trying to make sense of it. The only solution is to fix the garbage in the database directly. That ain’t good HTML. No amount of argument will make it so.

    Thread Starter tgiokdi

    (@tgiokdi)

    I’m honestly at a lost of how the data was loaded at all then, I assumed it was from the standard editor, thanks though.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Like I said, the “Text” editor will let you put in more or less what you like, and it doesn’t try to mess with it. If you put in garbage, it happily saves garbage. The Visual editors try very hard to not do that sort of thing. The new Block Editor simply won’t produce that sort of thing in the first place, which is one reason that it’s very much an upgrade from the old editor.

    Thread Starter tgiokdi

    (@tgiokdi)

    the new block editor is much worse with all the content I tested it with, nearly all the content was being changed in some catastrophic way that really made me unhappy, either by adding in new and exciting div/spans/paragraph tags or just losing youtube embeds completely. I’m not interested in using the block editor as I’m not looking to design a page, just looking to add text to a field and have it displayed as stored in the database.

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    The new block editor is just the thing for you then, because the Custom HTML block does pretty much exactly what you’re asking for there. It even turns off the autop for you when you use it.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Gutenberg / Classic Editor breaking posts’ is closed to new replies.