/**
 * @license Copyright (c) 2017-2025, CKSource Holding sp. z o.o. All rights reserved.
 * For licensing, see LICENSE.md.
 */

'use strict';

const transformCodeSwitcher = require( '../../utils/transformcodeswitcher' );

/**
 * Replaces <code-switcher> tags with the switchable code.
 * Tag syntax is <code-switcher>```js ```</code-switcher>.
 */
hexo.extend.filter.register( 'before_post_render', data => {
	if ( data.projectTheme === 'gloria' ) {
		return data;
	}

	return transformCodeSwitcher( data, hexo );
} );
