Comments (10)
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.
Sorry it took so long to reply. I haven't yet had enough time to look into this issue in detail, but I'm wondering if it's an issue with the code block itself, or with a compatibility issue with the plugin extending the code block. I would like to keep this issue open until there is clarity.
from gutenberg.
I think #58659 covers this issue, so I'd like to close it.
from gutenberg.
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.
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.
Is the code block you're using from Gutenberg core? If so, I think this should be fixed on Gutenberg's side.
from gutenberg.
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:
- Other blocks remain unchanged (image 3)
- 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.
/edit: fixed image order
from gutenberg.
I would like to add this issue to the WP6.5 project board as it might affect many developers.
from gutenberg.
Yeah great, @t-hamano . Anything I can do to help / assist? I've been out of the WP dev business quite some time but can always test or something.
from gutenberg.
Sorry for getting in touch with you so late. It turns out that the problem you reported has a much larger impact than I expected. A summary of the problem is summarized in #58659.
from gutenberg.
Related Issues (20)
- The Navigation Block has an Inline Style Without Declarations.
- Add support for section dividers in the Color section in the Inspector HOT 3
- Pattern navigation toggles zoom out view HOT 1
- "Add before" and "Add after" missing when editing pages in the Site Editor HOT 1
- Detaching patterns not available when editing pages in the Site Editor
- Text alignment controls in global styles for irrelevant blocks HOT 1
- DataViews for Posts, Categories and Tags HOT 4
- Button: add support for iconPosition top and showDescription HOT 4
- Polish UX when saving post metadata and create supporting data structures HOT 1
- Scaffolded block doesn't register in editor due to @wordpress/scripts version 28.0.0 HOT 1
- Pattern Overrides not rendering on Front End HOT 2
- [Flaky Test] Open the command palette and navigate to a template
- Uniform Focal point labels
- Editor: Link preview overflows with long strings and only shows postname
- Custom CSS for block with a block style variation is not rendered to the page.
- Editor: Text / Scrollbar flickering HOT 1
- Search Block: Settings to limit search results
- Search Block: Option to have live suggested results or word auto-completion HOT 1
- New Block: Query Results Count Block
- Disambiguate "Cover" translatable string in the context of `background-panel.js` HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
tags for empty lines within