Skip to content

Commit ade7817

Browse files
Update indentation removal for links
1 parent 89e33d1 commit ade7817

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

lib/src/rmui_bundle_update_suggestors/constants.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,10 @@ class Link {
5252
const Link({required this.pathSubpattern});
5353

5454
/// A pattern for finding a link tag with a matching path.
55-
RegExp get pattern => RegExp(r'<link[^>]*href="(?<path_prefix>[^"]*)' +
56-
pathSubpattern +
57-
r'"[^>]*>(?<trailing_new_line>\n?)');
55+
RegExp get pattern => RegExp(
56+
r'(?<preceding_whitespace>[^\S\r\n]*)<link[^>]*href="(?<path_prefix>[^"]*)' +
57+
pathSubpattern +
58+
r'"[^>]*>(?<trailing_new_line>\n?)');
5859

5960
@override
6061
String toString() =>

test/executables/react_18_upgrade_test.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ void main() {
8080
expectedOutput: d.dir('project', [
8181
d.file('dev.html', /*language=html*/ '''
8282
<link href="packages/react/js/react.dev.js">
83-
'''),
83+
'''),
8484
d.file('dev_with_addons.html', /*language=html*/ '''
8585
<link href="packages/react/js/react.dev.js">
86-
'''),
86+
'''),
8787
]),
8888
args: ['--yes-to-all']);
8989

@@ -100,10 +100,10 @@ void main() {
100100
expectedOutput: d.dir('project', [
101101
d.file('prod.html', /*language=html*/ '''
102102
<link href="packages/react/js/react.min.js">
103-
'''),
103+
'''),
104104
d.file('prod_with_addons.html', /*language=html*/ '''
105105
<link href="packages/react/js/react.min.js">
106-
''')
106+
''')
107107
]),
108108
args: ['--yes-to-all']);
109109
});

0 commit comments

Comments
 (0)