Skip to content

Commit

Permalink
refactor: change default code background color to avoid conflict with…
Browse files Browse the repository at this point in the history
… select color
  • Loading branch information
asjqkkkk committed Dec 12, 2023
1 parent c36529f commit b0c930a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/widget/inlines/code.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ class CodeConfig implements InlineConfig {
final TextStyle style;

const CodeConfig(
{this.style = const TextStyle(backgroundColor: Color(0xffeff1f3))});
{this.style = const TextStyle(backgroundColor: Color(0x4d555555))});

static CodeConfig get darkConfig =>
CodeConfig(style: const TextStyle(backgroundColor: Color(0xff555555)));
CodeConfig(style: const TextStyle(backgroundColor: Color(0xCC555555)));

@nonVirtual
@override
Expand Down
10 changes: 10 additions & 0 deletions test/widget_visitor_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ void main() {
| a | b | c | ''');
});

test('code block builder', () {
final spans = transformMarkdown('''```html
asdasdasdasd
```''',
config: MarkdownConfig(
configs: [PreConfig(builder: (code, language) => Text(code))]));
final textSpans = spans.map((e) => e.build()).toList();
assert(textSpans.length == 1);
});

test('getNodeByElement', () {
final visitor = WidgetVisitor();
visitor.getNodeByElement(
Expand Down

0 comments on commit b0c930a

Please sign in to comment.