feat(reasoning): Add html_unescape and enhance reasoning parser

This commit is contained in:
cogwheel0
2025-12-04 15:05:20 +05:30
parent cbbcdd8305
commit 6b1ecff302
5 changed files with 424 additions and 541 deletions

View File

@@ -0,0 +1,18 @@
/// HTML entity utilities for parsing content.
///
/// Reference: openwebui-src/src/lib/utils/index.ts (unescapeHtml)
library;
import 'package:html_unescape/html_unescape.dart';
/// Utility class for HTML entity handling.
class HtmlUtils {
/// HTML entity unescaper instance.
static final _unescape = HtmlUnescape();
/// Unescape HTML entities in a string.
///
/// Handles all Named, Decimal, and Hexadecimal Character References.
static String unescapeHtml(String s) => _unescape.convert(s);
}