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

Quick question, almost impossible to search for. Does Gutenberg not support the "code" block like visual editor? #6397

Closed
jcklpe opened this issue Apr 24, 2018 · 6 comments

Comments

@jcklpe
Copy link

jcklpe commented Apr 24, 2018

What I mean is when you want to mark something as code formatting. Does gutenberg not do that? I don't see any default blocks for it. And the backticks don't work the same way that ## and ### do for h2 and h3. So? It's out or what? Just curious.

@jcklpe
Copy link
Author

jcklpe commented Apr 24, 2018

Okay so I can copy a piece of code from a blog post and it will turn into a code block but I don't see how to insert the code block in manually, and I also don't see how to make that formatting inline?

I've said this before but there really does need to be some kind of inline formatting solution. Most things can be handled with blocks but not everything.

@karmatosed
Copy link
Member

You can do that through the code block:

2018-04-26 at 14 20

2018-04-26 at 14 20

You can also go into code view for the entire editor or a specific block:

2018-04-26 at 14 24

2018-04-26 at 14 25

Another option you have is the classic block:

2018-04-26 at 14 29

Unless I am wrong that gives you options for this so for now going to close. If this isn't what you find useful please add a comment and we can always reopen.

@jcklpe
Copy link
Author

jcklpe commented Apr 26, 2018

@karmatosed Oh dang! I don't see how I missed it in the block list. I could have sworn I didn't see it listed there when I checked before posting. Well thank you!

All that said, really do think there needs to be some kind of inline styling solution for gutenberg. It is technically possible to do this by using the classic block but inline styling feels at least fundamental enough to be considered for inclusion. As I indicated, previous markup derived quick shortcuts ce6rtainly indicate the usefulness of inserting code formatting for small snippets of code inline. And the functionality for inline styling already seems to exist in the form of bold, italics, and strikethrough in the default Paragraph block. Perhaps there is a way for a plugin to modify the Paragraph block behavior to allow for custom inline styles to be latched on? I don't know enough plugin stuff yet (newbie developer here. Just learned WP theming 6 Months ago but so far I love it!)

@chrisvanpatten
Copy link
Contributor

chrisvanpatten commented Apr 26, 2018

I agree — a native menu where you could register different inline styles would be excellent. Core has that via TinyMCE's custom styles and there isn't an analogue in Gutenberg's Paragraph block (or at least not an obvious one).

For instance I'd love to enable support for the <mark> tag in the editor, or <code> as you suggested. I've also worked with clients in the past where we had styles for various text formatting bits, like <span class="lead-text"> (where the first sentence in a paragraph might be formatted differently).

@chrisvanpatten
Copy link
Contributor

I agree — a native menu where you could register different inline styles would be excellent. Core has that via TinyMCE's custom styles and there isn't an analogue in Gutenberg's Paragraph block.

I think this could also be solved by #4658.

@jcklpe
Copy link
Author

jcklpe commented Apr 26, 2018

Yes @chrisvanpatten that does seem to fit the bill.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants