feat(ai-scribe): Fix the English locale file `(intl_en.arb)` is missing all three AI Scribe keys
feat(ai-scribe): Fix async function declared without proper return type annotation. feat(ai-scribe): Fix Async operations not properly awaited. feat(ai-scribe): Fix inconsistent capitalization between button labels. feat(ai-scribe): Fix GenerateAITextFailure check will never match. feat(ai-scribe): Fix consider validating text input for predefined actions. feat(ai-scribe): Using a subshell for directory isolation. feat(ai-scribe): Fix verify the mock usage or document intent. feat(ai-scribe): Using a more conventional import for Offset. feat(ai-scribe): Adding error handling for consistency feat(ai-scribe): Remove `fromJson` and `toJson` of AIResponse feat(ai-scribe): Using constants for role values. feat(ai-scribe): Using a more specific import. feat(ai-scribe): Using Timer for cleaner lifecycle management feat(ai-scribe): Adding error handling to fromMap() for consistency. feat(ai-scribe): Disposing the ValueNotifier feat(ai-scribe): Redundant null check after assignment feat(ai-scribe): Fix calling `registerSelectionChangeListener` multiple times may be inefficient. feat(ai-scribe): Safer type handling for JavaScript callback args feat(ai-scribe): Fix async callbacks not awaited in switch statement. feat(ai-scribe): Fix binding lifecycle mismatch for GetAIScribeConfigInteractor feat(ai-scribe): Fix ai prompts feat(ai-scribe): Fix unawaited async call to `_setupSelectionListener` feat(ai-scribe): Fix switch cases use top-origin coordinates while `PositionedDirectional(bottom:)`` expects bottom-origin coordinates. feat(ai-scribe): Adding error handling for selection listener setup.
This commit is contained in:
@@ -199,20 +199,25 @@ class StringConvert {
|
||||
}
|
||||
|
||||
static String convertHtmlContentToTextContent(String htmlContent) {
|
||||
final document = parse(htmlContent);
|
||||
try {
|
||||
final document = parse(htmlContent);
|
||||
|
||||
// Each paragraph is surrounded by block tags so we add a /n for each block tag
|
||||
// Even <br> are surrounded by block tags so we can ignore <br> and treat them
|
||||
// as paragraph
|
||||
const blockTags = 'p, div, li, section, blockquote, article, header, footer, h1, h2, h3, h4, h5, h6';
|
||||
// Each paragraph is surrounded by block tags so we add a /n for each block tag
|
||||
// Even <br> are surrounded by block tags so we can ignore <br> and treat them
|
||||
// as paragraph
|
||||
const blockTags = 'p, div, li, section, blockquote, article, header, footer, h1, h2, h3, h4, h5, h6';
|
||||
|
||||
document.querySelectorAll(blockTags).forEach((element) {
|
||||
element.append(Text('\n'));
|
||||
});
|
||||
document.querySelectorAll(blockTags).forEach((element) {
|
||||
element.append(Text('\n'));
|
||||
});
|
||||
|
||||
final String textContent = document.body?.text ?? '';
|
||||
final String textContent = document.body?.text ?? '';
|
||||
|
||||
return textContent.trim();
|
||||
return textContent.trim();
|
||||
} catch (e) {
|
||||
logError('StringConvert::convertHtmlContentToTextContent:Exception = $e');
|
||||
return htmlContent.trim();
|
||||
}
|
||||
}
|
||||
|
||||
static String convertTextContentToHtmlContent(String textContent) {
|
||||
|
||||
Reference in New Issue
Block a user