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

PHP is not a valid lang value, used on source code blocks #426

Open
adamwoodnz opened this issue Dec 11, 2023 · 1 comment
Open

PHP is not a valid lang value, used on source code blocks #426

adamwoodnz opened this issue Dec 11, 2023 · 1 comment
Labels
Accessibility Issues related to keyboard navigation, screen readers, etc

Comments

@adamwoodnz
Copy link
Contributor

          PHP is not a valid `lang` value, used on source code blocks

Screenshot 2023-11-23 at 4 08 10 PM

Originally posted by @adamwoodnz in #179 (comment)

@adamwoodnz adamwoodnz added the Accessibility Issues related to keyboard navigation, screen readers, etc label Dec 11, 2023
@ryelle
Copy link
Contributor

ryelle commented Jan 17, 2024

Looks like this is coming from Code Syntax Block, and there's a PR mkaz/code-syntax-block#85 … which is maybe blocked upstream 🙃

This affects all sites using the Code Syntax Block (which might just be this one & the developer blog), so we should probably drop something in wporg-mu-plugins to fix it. Something like this would work, even if it's hacky.

add_filter(
	'render_block_core/code',
	function( $block_content ) {
		// Only replaces php, but other sites use javascript and others, so ideally this would catch all.
		return str_replace( 'lang="php"', '', $block_content );
	}
);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accessibility Issues related to keyboard navigation, screen readers, etc
Projects
None yet
Development

No branches or pull requests

2 participants