', $parts);
}
$start_line = (int) ($advanced['startLine']['desktop']['value'] ?? 1);
if ($start_line < 1) {
$start_line = 1;
}
$highlight = self::sanitize_highlight_lines($advanced['highlightLines']['desktop']['value'] ?? '');
// The block scrolls, so it must be focusable; role="region" plus a name
// means a screen-reader user is told what they have landed in.
$label = '' !== $file_name
/* translators: %s: the snippet's file name. */
? sprintf(__('Code sample: %s', 'addons-for-divi'), $file_name)
: __('Code sample', 'addons-for-divi');
// Prism's line-numbers plugin activates on `pre.line-numbers` — the
// wrapper modifier alone does nothing, so the gutter has to be asked
// for on the element the plugin actually looks at.
$show_numbers = ($advanced['showLineNumbers']['desktop']['value'] ?? 'on') !== 'off';
$pre_html = sprintf(
'
'
. '%6$s
',
$show_numbers ? ' line-numbers' : '',
esc_attr($label),
$start_line,
'' !== $highlight ? sprintf(' data-line="%s"', esc_attr($highlight)) : '',
esc_attr($language),
self::escape_code($code)
);
// The copy confirmation is announced rather than only shown.
$status_html = $show_copy && $show_header
? ''
: '';
$children = sprintf(
'