flutter_html icon indicating copy to clipboard operation
flutter_html copied to clipboard

[BUG] Only the first builder function is called when there are multiple TagWrapExtensions

Open incofab opened this issue 1 year ago • 0 comments

Describe the bug: If I have more than one TagWrapExtension for different Tags and what to wrap then with different tags. All the tags eventually gets wrapped by the same tag of the first TagWrapExtension in the entry.

HTML to reproduce the issue:

  Html(
          document: data,
          extensions: [
            TagWrapExtension(
              tagsToWrap: {'table', 'math'},
              builder: (child) {
                return SingleChildScrollView(
                  scrollDirection: Axis.horizontal,
                  child: Container(
                    width: 700,
                    margin: const EdgeInsets.symmetric(vertical: 5),
                    child: child,
                  ),
                );
              },
            ),
            TagWrapExtension(
              tagsToWrap: {'p''},
              builder: (child) {
                return  Container(
                    height: 100,
                    margin: const EdgeInsets.symmetric(vertical: 20),
                    child: child,
                );
              },
            ),
     ]
);

Html widget configuration:

Expected behavior: The builder function of each TagWrapExtension should be applied to accordingly

Screenshots:

Device details and Flutter/Dart/flutter_html versions:

Stacktrace/Logcat

Additional info:

A picture of a cute animal (not mandatory but encouraged)

incofab avatar Sep 03 '24 15:09 incofab