feat(reasoning): Add html_unescape and enhance reasoning parser
This commit is contained in:
18
lib/core/utils/html_utils.dart
Normal file
18
lib/core/utils/html_utils.dart
Normal 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user