| @@ -27,9 +27,19 @@ | ||
| 27 | 27 | |
| 28 | 28 | return $url ? '[' . $url . '](' . str_replace(')', '%29', $url) . ')' : $matches[0]; |
| 29 | 29 | }, (string) $description); |
| 30 | 30 | |
| 31 | - return wp_kses_post($description); | |
| 31 | + // KSES encodes standalone > characters, which breaks Markdown quotes. | |
| 32 | + // Protect only quote prefixes; all HTML still passes through KSES. | |
| 33 | + $quotePrefix = 'fbs-quote-' . wp_generate_uuid4() . '-'; | |
| 34 | + $quotes = []; | |
| 35 | + $description = preg_replace_callback('/^[ \t]*(?:>[ \t]*)+/m', function ($matches) use (&$quotes, $quotePrefix) { | |
| 36 | + $key = $quotePrefix . count($quotes); | |
| 37 | + $quotes[$key] = $matches[0]; | |
| 38 | + return $key; | |
| 39 | + }, $description); | |
| 40 | + | |
| 41 | + return strtr(wp_kses_post($description), $quotes); | |
| 32 | 42 | } |
| 33 | 43 | } |
| 34 | 44 | |
| 35 | 45 | if (!function_exists('fluent_boards_user_avatar')) { |