Plugin Directory

Changeset 3233214


Ignore:
Timestamp:
02/01/2025 07:50:56 PM (14 months ago)
Author:
quickpressai
Message:

Updated plugin files for version 1.7.6

Location:
quickpressai/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • quickpressai/trunk/quickpressai.php

    r3232306 r3233214  
    33Plugin Name: QuickPress AI
    44Description: 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.5
     5Version: 1.7.6
    66Author: QuickPress AI
    77Author URI: https://quickpressai.com/
     
    1717}
    1818
    19 define('QUICKPRESS_AI_VERSION', '1.7.5');
     19define('QUICKPRESS_AI_VERSION', '1.7.6');
    2020define('QUICKPRESS_AI_DEBUG', false);
    2121
     
    748748         }
    749749
    750          // Convert lists
    751         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 block
    755                     $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 
    762750         // Convert blockquotes
    763751         elseif (preg_match('/^> (.+)/', $line, $matches)) {
     
    797785         }
    798786
    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        }
    809819
    810820         // Convert italic text
     
    919929}
    920930
     931function quickpress_format_bold_text($text) {
     932   return preg_replace('/\*\*(.+?)\*\*/', '<strong>$1</strong>', esc_html($text));
     933}
     934
    921935function quickpress_init_list_block(&$current_list_block, $ordered) {
    922936    if ($current_list_block === null) {
     
    10441058
    10451059    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));
    10471061    }
    10481062
     
    10501064
    10511065    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));
    10541067    }
    10551068
  • quickpressai/trunk/readme.txt

    r3232306 r3233214  
    55Tags: ai, seo, automation, content generator, content creation
    66Tested up to: 6.7
    7 Stable tag: 1.7.5
     7Stable tag: 1.7.6
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    6565== Changelog ==
    6666
     67= 1.7.6 =
     68* Fixed issue with converting lists to WP blocks
     69* Fixed issue with formatting bold text
     70
    6771= 1.7.5 =
    6872* Fixed reset API key bug
Note: See TracChangeset for help on using the changeset viewer.