Skip to content

Commit d932e62

Browse files
committed
Assert that tag_name is alphabetic
1 parent f8ca576 commit d932e62

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/librustdoc/html/length_limit.rs

+8
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,15 @@ impl HtmlWithLimit {
7272
}
7373

7474
/// Open an HTML tag.
75+
///
76+
/// **Note:** HTML attributes have not yet been implemented.
77+
/// This function will panic if called with a non-alphabetic `tag_name`.
7578
pub(super) fn open_tag(&mut self, tag_name: &'static str) {
79+
assert!(
80+
tag_name.chars().all(|c| ('a'..='z').contains(&c)),
81+
"tag_name contained non-alphabetic chars: {:?}",
82+
tag_name
83+
);
7684
self.queued_tags.push(tag_name);
7785
}
7886

0 commit comments

Comments
 (0)