diff --git a/src/librustdoc/html/markdown.rs b/src/librustdoc/html/markdown.rs
index 6dbf2185e3d03..d24e6e5faf521 100644
--- a/src/librustdoc/html/markdown.rs
+++ b/src/librustdoc/html/markdown.rs
@@ -1083,7 +1083,7 @@ impl<'a, 'tcx> TagIterator<'a, 'tcx> {
}
fn parse_in_attribute_block(&mut self) -> Option> {
- while let Some((pos, c)) = self.inner.next() {
+ if let Some((pos, c)) = self.inner.next() {
if c == '}' {
self.is_in_attribute_block = false;
return self.next();