Skip to content

Commit

Permalink
feat(html): Ignore wrap text
Browse files Browse the repository at this point in the history
Wrap text feature is added to make line wrap on some type of content
(e.g. url) act like what in browser.

But the wrapped text costs time and makes copy-content unusable.

This commit ignored the wrap text flag when munching html content to
make copy-content possible and restore what flutter originally doing.
  • Loading branch information
realth000 committed Sep 14, 2024
1 parent 02bfa65 commit 14bf9be
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/utils/html/html_muncher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ class _MunchState {
/// in some special case (e.g. url) we want to wrap the line inside words.
///
/// Turn on this flag in such situation.
///
/// THIS OPTION IS NOT IGNORED, prepare for copy content feature.
bool wrapInWord = false;

/// Url link to tap.
Expand Down Expand Up @@ -245,8 +247,9 @@ final class _Muncher with LoggerMixin {
..headingBrNodePassed = true
..inRepeatWrapLine = false;

final wrapText =
state.wrapInWord ? text?.split('').join('\u200B') : text;
final wrapText = text;
// Ignore wrap text;
// state.wrapInWord ? text?.split('').join('\u200B') : text;

// TODO: Support text-shadow.
return [
Expand Down

0 comments on commit 14bf9be

Please sign in to comment.