<commit_before><?php
/*
Lägg följande kod i functions.php eller gör en 
require_once("responsive_art_direction.php");
*/

function responsive_art_direction(){
	global $post;

	$spinner = 'src="' . get_bloginfo("stylesheet_directory") . "/spinner.gif" . '"';

	$img = preg_replace('#(<img.+?)(src="[^"]*")(.*?/?>)#i', '$1data-default-$2 ' . $spinner . '$3', $post->post_content);
	$img = preg_replace('#(<img(.*?))(width="[^"]*"){1}(.*?/?>)#i', '$1$4', $img);
	$img = preg_replace('#(<img(.*?))(height="[^"]*"){1}(.*?/?>)#i', '$1$4', $img);
	return $img;

}
add_filter("the_content", "responsive_art_direction", 9);


?><commit_msg>Update responsive_art_direction.php<commit_after><?php
/*
Lägg följande kod i functions.php eller gör en 
require_once("responsive_art_direction.php");
*/

function responsive_art_direction(){
	global $post;

	$spinner = 'src="' . get_bloginfo("stylesheet_directory") . "/spinner.gif" . '"';

	$img = preg_replace('#(<img.+?)(src="[^"]*")(.*?/?>)#i', '$1data-default-$2 ' . $spinner . '$3', $post->post_content);
	$img = preg_replace('#(<img(.*?))(width="[^"]*"){1}(.*?/?>)#i', '$1$4', $img);
	$img = preg_replace('#(<img(.*?))(height="[^"]*"){1}(.*?/?>)#i', '$1$4', $img);
	$img = preg_replace('#(<img(.*?))([ ]{2,}){1,}(.*?/?>)#i', '$1 $4', $img);
	return $img;

}
add_filter("the_content", "responsive_art_direction", 9);


?>
{'fraction_non_alphanumeric': 0.31691176470588234, 'fraction_numerical': 0.01764705882352941, 'mean_word_length': 6.23936170212766, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '491790', 'n_tokens_mistral': 587, 'n_tokens_neox': 540, 'n_words': 81}