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

HTML Block: Toggle syntax highlighting #5614

Open
mtias opened this issue Mar 14, 2018 · 10 comments
Open

HTML Block: Toggle syntax highlighting #5614

mtias opened this issue Mar 14, 2018 · 10 comments
Labels
[Block] HTML Affects the the HTML Block [Feature] Blocks Overall functionality of blocks [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Enhancement A suggestion for improvement.

Comments

@mtias
Copy link
Member

mtias commented Mar 14, 2018

Add a toggle to disable syntax highlighting in the inspector:

image

Considerations

Should this be a per-block settings or user setting? I feel if I want to disable syntax highlighting I'd appreciate it being disabled across the board.

cc @jasmussen

@mtias mtias added [Feature] Blocks Overall functionality of blocks Needs Design Feedback Needs general design feedback. labels Mar 14, 2018
@jasmussen
Copy link
Contributor

I feel if I want to disable syntax highlighting I'd appreciate it being disabled across the board.

I think a per-block toggle would probably be frustrating, as you'd get tired of having to flip it for every new block you inserted. It seems a more global toggle would be better.

Should such a toggle live in the More menu, perhaps under the "Fix toolbar to block" toggle?

@mtias mtias changed the title HTML Block HTML Block: Toggle syntax highlighting Mar 14, 2018
@mtias
Copy link
Member Author

mtias commented Mar 14, 2018

Should such a toggle live in the More menu, perhaps under the "Fix toolbar to block" toggle?

I wouldn't mind it existing in the HTML Block inspector control (which is empty, and the first place I'd look) but being a global setting. (We can clarify that in the toggle.)

@karmatosed
Copy link
Member

Should such a toggle live in the More menu, perhaps under the "Fix toolbar to block" toggle?

I kind of like it in the more menu.

@karmatosed karmatosed removed the Needs Design Feedback Needs general design feedback. label Mar 27, 2018
@bobbingwide
Copy link
Contributor

Please can you explain this requirement.

There is already a user level field labelled Syntax Highlighting which is used to control whether or not syntax is highlighted in the Customiser > Additional CSS and the Custom HTML Widget.
issue 5614 - syntax highlighting

@westonruter
Copy link
Member

I noticed that when I toggled the Syntax Highlighting option off that the Custom HTML block editor fails to render entirely.

@mtias mtias added the [Type] Enhancement A suggestion for improvement. label Jul 17, 2018
@afercia afercia added the [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). label Jul 30, 2018
@afercia afercia added this to the WordPress 5.0 milestone Jul 30, 2018
@afercia
Copy link
Contributor

afercia commented Jul 30, 2018

Adding the accessibility label and 5.0 milestone as this is strictly related to #5467 that's already milestoned for 5.0.

@afercia
Copy link
Contributor

afercia commented Jul 30, 2018

Any chance to integrate this as a "global" option based on the existing user preference "Disable syntax highlighting when editing code"?

@afercia
Copy link
Contributor

afercia commented Sep 3, 2018

Discussed during today's accessibility bug-scrub and agreed ideally it should be based on the existing user option.

@aldavigdis also proposed to consider a "global" option for administrator who might want to disable it by default for all users, and users allowed to override the default.

@aldavigdis
Copy link
Contributor

Just a soft suggestion. Putting things out in the ether.

@mtias
Copy link
Member Author

mtias commented Nov 4, 2018

Pushing this to future versions as we have disabled syntax highlighting by default on this block, which is a better baseline at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] HTML Affects the the HTML Block [Feature] Blocks Overall functionality of blocks [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

9 participants