Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<sub> and <sup> tag aren't working in the android emulator #134

Closed
KaMoKuMo opened this issue Jul 23, 2019 · 5 comments
Closed

<sub> and <sup> tag aren't working in the android emulator #134

KaMoKuMo opened this issue Jul 23, 2019 · 5 comments
Labels
more-info-needed More information is needed to resolve the issue. Will be closed if no response is received.

Comments

@KaMoKuMo
Copy link

When I tried to emulate the example app on an Pixel 2, using Android 9.0, using AndroidStudio it would neither display the "< sub>2< /sub>" tag at the logs nor the "< sup>2< /sup >" tag at the following x.

@Sub6Resources
Copy link
Owner

It should at least display them, though incorrectly. Please post the configuration of your Html widget and the version of flutter_html you are using.

@Sub6Resources Sub6Resources added the more-info-needed More information is needed to resolve the issue. Will be closed if no response is received. label Jul 24, 2019
@KaMoKuMo
Copy link
Author

I'm not sure what you mean by Html widget config. I copy-pasted your example main.dart into a new flutter project (main.dart) and wrote: ^0.10.4 into the pubspec.yaml

@KaMoKuMo
Copy link
Author

    child: SingleChildScrollView(
      child: Html(
        data: ..., 
        //Optional parameters:
        padding: EdgeInsets.all(8.0),
        linkStyle: const TextStyle(
          color: Colors.redAccent,
          decorationColor: Colors.redAccent,
          decoration: TextDecoration.underline,
        ),
        onLinkTap: (url) {
          print("Opening $url...");
        },
        onImageTap: (src) {
          print(src);
        },
        //Must have useRichText set to false for this to work
        customRender: (node, children) {
          if (node is dom.Element) {
            switch (node.localName) {
              case "custom_tag":
                return Column(children: children);
            }
          }
          return null;
        },
        customTextAlign: (dom.Node node) {
          if (node is dom.Element) {
            switch (node.localName) {
              case "p":
                return TextAlign.justify;
            }
          }
          return null;
        },
        customTextStyle: (dom.Node node, TextStyle baseStyle) {
          if (node is dom.Element) {
            switch (node.localName) {
              case "p":
                return baseStyle.merge(TextStyle(height: 2, fontSize: 20));
            }
          }
          return baseStyle;
        },
      ),
    ),

@KaMoKuMo
Copy link
Author

Do you need any other information?

@KaMoKuMo
Copy link
Author

KaMoKuMo commented Aug 7, 2019

By setting:
useRichtText = false;
the problem is circumvented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more-info-needed More information is needed to resolve the issue. Will be closed if no response is received.
Projects
None yet
Development

No branches or pull requests

2 participants