mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-04-20 23:27:44 -04:00
fix(xtask): Fix an infinite loop when parsing the fields of a span.
The error was coming from the subslice from `message` instead of `fields`. This patch also fixes an HTML error (`</li>` right after `<ul>`).
This commit is contained in:
@@ -72,7 +72,7 @@ lazy_static! {
|
||||
^
|
||||
|
||||
# A name.
|
||||
(?<name>[\w\d_]+)
|
||||
\s*(?<name>[\w\d_]+)
|
||||
# Equal
|
||||
=
|
||||
# A value, which can be anything: it stops when a new field is found.
|
||||
@@ -333,9 +333,9 @@ pub(super) fn run(log_path: path::PathBuf, output_path: path::PathBuf) -> Result
|
||||
.unwrap();
|
||||
|
||||
if let Some(fields) = captures.name("fields") {
|
||||
writeln!(buffer, "<ul class=\"fields\"></li>").unwrap();
|
||||
writeln!(buffer, "<ul class=\"fields\">").unwrap();
|
||||
|
||||
let mut fields = &message[fields.start()..];
|
||||
let mut fields = &message[fields.start()..fields.end()];
|
||||
|
||||
while let Some(captures) = fields_parser.captures(fields) {
|
||||
let name = captures
|
||||
@@ -350,7 +350,7 @@ pub(super) fn run(log_path: path::PathBuf, output_path: path::PathBuf) -> Result
|
||||
writeln!(buffer, "<li><span>{name}</span><span>{value}</span></li>").unwrap();
|
||||
|
||||
if let Some(next_fields) = captures.name("next_fields") {
|
||||
fields = &message[next_fields.start()..];
|
||||
fields = &fields[next_fields.start()..];
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user