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

customEdgeInsets doesn't work #94

Closed
martinellimarco opened this issue May 26, 2019 · 2 comments
Closed

customEdgeInsets doesn't work #94

martinellimarco opened this issue May 26, 2019 · 2 comments
Labels
more-info-needed More information is needed to resolve the issue. Will be closed if no response is received.

Comments

@martinellimarco
Copy link

I tried to add a padding around an with this code:

customEdgeInsets: (node){
  if(node is dom.Element) {
    switch(node.localName) {
      case "img":return const EdgeInsets.symmetric(vertical: 8.0);
    }
  }
}

but it doesn't work.
Looking into the source code I've found that the returned value from here

EdgeInsets _customEdgeInsets;
if (customEdgeInsets != null) {
_customEdgeInsets = customEdgeInsets(node);
}

is ignored for all html tags except for this
BlockText blockText = BlockText(
margin: node.localName != 'body'
? _customEdgeInsets ??
EdgeInsets.only(
top: 8.0,
bottom: 8.0,
left: parseContext.indentLevel * indentSize)
: EdgeInsets.zero,

Is it possible to make it works for other tags too?

@Sub6Resources
Copy link
Owner

Sorry for the delayed response. customEdgeInsets is ignored by the body, but is supported by all other block elements. Is useRichText set to true?

@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 17, 2019
@Sub6Resources
Copy link
Owner

Closing due to inactivity. Reopen if you encounter this issue again.

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