/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/block-library/src/code/save.js
22 строки
639 B
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import { RichText, useBlockProps } from '@wordpress/block-editor'; import { escape } from './utils'; export default function save( { attributes } ) { return ( <pre { ...useBlockProps.save() }> <RichText.Content tagName="code" // To do: `escape` encodes characters in shortcodes and URLs to // prevent embedding in PHP. Ideally checks for the code block, // or pre/code tags, should be made on the PHP side? value={ escape( typeof attributes.content === 'string' ? attributes.content : attributes.content.toHTMLString( { preserveWhiteSpace: true, } ) ) } /> </pre> ); }