GithubHelp home page GithubHelp logo

Comments (5)

Digiover avatar Digiover commented on June 8, 2024

Addendum

What I meant with

Problem first noticed in Gutenberg version 16.9.0.

is that 16.9.0 was the first version I noticed markup issues with code blocks (EOL completely missing, everything came on line line). Now with 17.2.0 the <br>'s are added withing <pre><code>

from gutenberg.

t-hamano avatar t-hamano commented on June 8, 2024

Thanks for the report.

I was also able to confirm this symptom, but I think this behavior is an intentional change.

The PR related to this change is #55999, which mentions:

Now all rich text values serialise the same way, with line breaks always serialising to the HTML BR tag.

I don't think this behavior is a bug, so I'd like to close this issue, but if there's anything I've missed, please comment.

from gutenberg.

Digiover avatar Digiover commented on June 8, 2024

Thank you for your reply @t-hamano . Can't say I'm happy with it though...

Apparently, it's allowed to use <br> in <pre> according to the HTML specifications (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/pre#technical_summary, https://developer.mozilla.org/en-US/docs/Web/HTML/Content_categories#phrasing_content) but it's changes like these that break sites. Since Gutenberg 16.9.0 -for as far as I remember- my site's code blocks are all messed up, without any indication why.

And now I still have to edit every post to fix code blocks, because I guess this isn't getting reversed.

from gutenberg.

t-hamano avatar t-hamano commented on June 8, 2024

@digover

Is the code block you're using from Gutenberg core? If so, I think this should be fixed on Gutenberg's side.

from gutenberg.

Digiover avatar Digiover commented on June 8, 2024

@digover

Is the code block you're using from Gutenberg core? If so, I think this should be fixed on Gutenberg's side.

Yes, it's the Gutenberg core code block. But I have had "syntax highlighting" plugins installed, so there is no telling what is in my database now :) I removed those plugins a while ago.

Just tested it quickly: I do have to edit a code block. First image is how a random posts code block looks, second image is after editing (I added EOL's until </filter>, but pressing Update fixed the entire block. Caveats:

  1. Other blocks remain unchanged (image 3)
  2. only opening the "edit post" page en pressing "Update" doesn't do anything to fix the block. I have to change the block. See image 4, which is image 3 after inserting an space.

image 1
image 2
image 3
image 4

/edit: fixed image order

from gutenberg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.