diff --git a/src/html/usage.rs b/src/html/usage.rs index 5ea89472..b40ceadc 100644 --- a/src/html/usage.rs +++ b/src/html/usage.rs @@ -21,7 +21,8 @@ thread_local! { } lazy_static! { - static ref IDENTIFIER_RE: Regex = Regex::new(r"[^a-zA-Z$_]").unwrap(); + static ref IDENTIFIER_RE: Regex = + Regex::new(r"^[0-9]|[^a-zA-Z0-9$_]").unwrap(); } fn render_css_for_usage(name: &str) -> String { diff --git a/tests/snapshots/html_test__html_doc_files_multiple-66.snap b/tests/snapshots/html_test__html_doc_files_multiple-66.snap index 0f556760..9f797e0b 100644 --- a/tests/snapshots/html_test__html_doc_files_multiple-66.snap +++ b/tests/snapshots/html_test__html_doc_files_multiple-66.snap @@ -105,8 +105,8 @@ Variables
import * as bar from "foo";
-
import bar from "foo"; -
import bar123 from "foo"; +