Changeset 3233214
- Timestamp:
- 02/01/2025 07:50:56 PM (14 months ago)
- Location:
- quickpressai/trunk
- Files:
-
- 2 edited
-
quickpressai.php (modified) (7 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
quickpressai/trunk/quickpressai.php
r3232306 r3233214 3 3 Plugin Name: QuickPress AI 4 4 Description: Quickly generate high-quality content in WordPress with an AI writing assistant that prioritizes creative freedom, flexibility, and ease of use. 5 Version: 1.7. 55 Version: 1.7.6 6 6 Author: QuickPress AI 7 7 Author URI: https://quickpressai.com/ … … 17 17 } 18 18 19 define('QUICKPRESS_AI_VERSION', '1.7. 5');19 define('QUICKPRESS_AI_VERSION', '1.7.6'); 20 20 define('QUICKPRESS_AI_DEBUG', false); 21 21 … … 748 748 } 749 749 750 // Convert lists751 elseif (preg_match('/^- (.+)/', $line, $matches)) {752 if ($current_list_block === null || $current_list_block['attrs']['ordered'] !== false) {753 if ($current_list_block) {754 // Close the previous list block755 $blocks[] = $current_list_block;756 }757 quickpress_init_list_block($current_list_block, false);758 }759 $current_list_block['innerContent'][] = '<li>' . wp_kses_post($matches[1]) . '</li>';760 }761 762 750 // Convert blockquotes 763 751 elseif (preg_match('/^> (.+)/', $line, $matches)) { … … 797 785 } 798 786 799 // Convert bold text 800 elseif (preg_match('/\*\*(.+?)\*\*/', $line)) { 801 quickpress_close_list_block($blocks, $current_list_block); 802 $blocks[] = [ 803 'blockName' => 'core/paragraph', 804 'attrs' => [], 805 'innerHTML' => '<p>' . preg_replace('/\*\*(.+?)\*\*/', '<strong>$1</strong>', esc_html($line)) . '</p>', 806 'innerContent' => [preg_replace('/\*\*(.+?)\*\*/', '<strong>$1</strong>', esc_html($line))], 807 ]; 808 } 787 // Convert unordered and ordered lists 788 elseif (preg_match('/^(\*|-|\d+\.) (.+)/', $line, $matches)) { 789 $is_ordered = is_numeric($matches[1][0]); // Check if the first character is a number (ordered list) 790 791 // Initialize or switch list block type if needed 792 if ($current_list_block === null || $current_list_block['attrs']['ordered'] !== $is_ordered) { 793 if ($current_list_block) { 794 // Close the previous list block 795 $blocks[] = $current_list_block; 796 } 797 quickpress_init_list_block($current_list_block, $is_ordered); 798 } 799 800 // Process bold formatting inside list items 801 $formatted_text = quickpress_format_bold_text(trim($matches[2])); 802 803 // Ensure the list items are being added correctly 804 $current_list_block['innerContent'][] = '<li>' . $formatted_text . '</li>'; 805 } 806 807 // Convert bold text in standalone paragraphs 808 elseif (preg_match('/\*\*(.+?)\*\*/', $line)) { 809 quickpress_close_list_block($blocks, $current_list_block); 810 $formatted_text = quickpress_format_bold_text($line); 811 812 $blocks[] = [ 813 'blockName' => 'core/paragraph', 814 'attrs' => [], 815 'innerHTML' => '<p>' . $formatted_text . '</p>', 816 'innerContent' => [$formatted_text], 817 ]; 818 } 809 819 810 820 // Convert italic text … … 919 929 } 920 930 931 function quickpress_format_bold_text($text) { 932 return preg_replace('/\*\*(.+?)\*\*/', '<strong>$1</strong>', esc_html($text)); 933 } 934 921 935 function quickpress_init_list_block(&$current_list_block, $ordered) { 922 936 if ($current_list_block === null) { … … 1044 1058 1045 1059 if (defined('QUICKPRESS_AI_DEBUG') && QUICKPRESS_AI_DEBUG) { 1046 error_log('[quickpress_ai_fetch_venice_api_response] Raw Array Before Encoding: ' . var_export($payload_array, true));1060 //error_log('[quickpress_ai_fetch_venice_api_response] Raw Array Before Encoding: ' . var_export($payload_array, true)); 1047 1061 } 1048 1062 … … 1050 1064 1051 1065 if (defined('QUICKPRESS_AI_DEBUG') && QUICKPRESS_AI_DEBUG) { 1052 error_log('[quickpress_ai_fetch_venice_api_response] Raw Array as JSON: ' . json_encode($payload_array, JSON_PRETTY_PRINT)); 1053 1066 //error_log('[quickpress_ai_fetch_venice_api_response] Raw Array as JSON: ' . json_encode($payload_array, JSON_PRETTY_PRINT)); 1054 1067 } 1055 1068 -
quickpressai/trunk/readme.txt
r3232306 r3233214 5 5 Tags: ai, seo, automation, content generator, content creation 6 6 Tested up to: 6.7 7 Stable tag: 1.7. 57 Stable tag: 1.7.6 8 8 License: GPLv2 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 65 65 == Changelog == 66 66 67 = 1.7.6 = 68 * Fixed issue with converting lists to WP blocks 69 * Fixed issue with formatting bold text 70 67 71 = 1.7.5 = 68 72 * Fixed reset API key bug
Note: See TracChangeset
for help on using the changeset viewer.