internal page anchors are totally being butchered

  • Unknown's avatar

    I have several pages with helpful links internally to other sections of the page, and at some point the new editor saved a ton of several times randomly throughout the page. I try to correct them, and when I update it puts extra ones back out again. I work only in the code editor, as that’s where I (used to) have any semblance of control over what is going on.

  • Hi there,

    Can you give the URL of one of these pages, and some more details on exactly what’s happening? It’s not entirely clear from your description.

    It might also help if you can take a screenshot of a GIF screencast that shows the issue. If you upload that to your media library at My Site ->Site ->Media, we’ll be able to see it there.

  • Unknown's avatar

    Sure — here’s one: https://mmmrhubarb.wordpress.com/baseball-cards/topps-2010s/

    Only the link to year 2017 works (which I “fixed”) – the others were wiped out (unknown to me at the time) in one of my first edits with the new editor. Even though it works, there are still multiple that got added.

    Another example is here: https://wordpress.com/block-editor/page/mmmrhubarb.wordpress.com/1797
    At some point when I edited the page, the links were wiped out, and there are multiple lines added of or

  • Unknown's avatar

    oh, nice — my code examples in the comment got stripped out.

    Here’s a screenshot of what I was talking about, with multiple lines added to the page:

  • That’s odd!

    Would you mind deleting and re-creating the affected block from scratch? Maybe on a test page so you don’t have to edit the live post?

  • Unknown's avatar

    I created a test page, pasted a copy of the problem code to it, fixed it, and the preview works just fine. Note: I was using the former editor, and working with a preview not published page.

    When I copied the test page’s working code back to the problem page (with the new editor) and saved it, it had the extraneous mystery anchor HTML scattered in it.

    Besides the fact that it’s messing up my previously fine webpages, I do not like the editor’s larger font, the extra spacing between lines, and several other aspects.

  • Hm, ok, if it works well in a new page, most likely the editor is struggling with stray HTML somewhere else in the page you’re working on.

    Try re-creating each block one by one, and you should wind up eliminating the problem block that way.

  • Unknown's avatar

    No, I’m saying it worked well in the new page, and when I COPY THE WHOLE PAGE IN ITS ENTIRETY back to the old page, it ends up wonky there. Only difference? The editor.

    Getting back to my other critiques, how do I reduce the editor’s font and eliminate the whitespace between lines so I can see more than a handful of lines of HTML?

  • No, I’m saying it worked well in the new page, and when I COPY THE WHOLE PAGE IN ITS ENTIRETY back to the old page, it ends up wonky there. Only difference? The editor.

    Does it show the extra code the moment you copy, or only after you save/update?

    Looking at your screen shot in https://mmmrhubarb.files.wordpress.com/2020/09/capture2.jpg and your post at https://mmmrhubarb.wordpress.com/baseball-cards/topps-2010s/ I don’t see any block markup there. Did you just type/paste that HTML directly in the code editor view? If so, that might be causing the problem.

    The “Code Editor” is not intended to be used as a plain HTML editor, so it’s possible this is happening because the editor is trying to add the missing block markup.

    If you prefer to create entire posts/pages using HTML, can you check if typing it inside the Custom HTML block instead works better? That block is a closer analogue to the HTML view from the classic editor, than the code editor view of the block editor.

    Custom HTML Block

    Getting back to my other critiques, how do I reduce the editor’s font and eliminate the whitespace between lines so I can see more than a handful of lines of HTML?

    The code editor is designed to add whitespace between separate blocks, to make reading and debugging the code easier. There is no way to prevent this.

    You might be able to reduce the editor’s font using custom CSS in your browser using a browser add-on like Stylus. But I had a look and it appears there’s an !important on the CSS setting the current font size, and I can’t find a way to override that, so this might not be possible either.

  • The topic ‘internal page anchors are totally being butchered’ is closed to new replies.