Skip to content

Patch ColorTag - #16

Open
kechuan wants to merge 2 commits into
MartenM:mainfrom
kechuan:main
Open

Patch ColorTag#16
kechuan wants to merge 2 commits into
MartenM:mainfrom
kechuan:main

Conversation

@kechuan

Copy link
Copy Markdown

filter unformat HEXColor to prevent FormatException crash.

my Example:

BBCodeText(
data:"[color=#ffffff]test[/color] \n""[color=ffffff]test[/color] \n""[color=33ffffff]test[/color]"//typo"[color=RED]test[/color]", //otherReason
stylesheet:BBStylesheet(
tags: [PatchColorTag()],
)
)
...
//colorTagif(hexColorRegExp.hasMatch(hexColor)){
debugPrint("match it: $hexColor");
return oldStyle.copyWith(color:HexColor.fromHex(hexColor));
}

output:
flutter: match it: #ffffff
flutter: match it: ffffff

filter unformat HEXColor to prevent FormatException crash.
was edited in Web. no attention on it.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@kechuan