/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/block-library/src/paragraph/save.js
21 строка
578 B
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import clsx from 'clsx'; import { RichText, useBlockProps } from '@wordpress/block-editor'; import { isRTL } from '@wordpress/i18n'; export default function save( { attributes } ) { const { content, dropCap, direction, style } = attributes; const textAlign = style?.typography?.textAlign; const className = clsx( { 'has-drop-cap': textAlign === ( isRTL() ? 'left' : 'right' ) || textAlign === 'center' ? false : dropCap, } ); return ( <p { ...useBlockProps.save( { className, dir: direction } ) }> <RichText.Content value={ content } /> </p> ); }