@@ -38,6 +38,10 @@ pub fn parse_jsdoc(
3838 // This includes inline code blocks or markdown-style code inside comments.
3939 let mut in_backticks = false ;
4040
41+ // Track whether we're currently inside quotes '...' or "..."
42+ // This includes package names when doing a @import
43+ let mut in_quotes = false ;
44+
4145 // This flag tells us if we have already found the main comment block.
4246 // The first part before any @tags is considered the comment. Everything after is a tag.
4347 let mut comment_found = false ;
@@ -52,8 +56,11 @@ pub fn parse_jsdoc(
5256 while let Some ( ch) = chars. next ( ) {
5357 // A `@` is only considered the start of a tag if we are not nested inside
5458 // braces, square brackets, or backtick-quoted sections
55- let can_parse =
56- curly_brace_depth == 0 && square_brace_depth == 0 && brace_depth == 0 && !in_backticks;
59+ let can_parse = curly_brace_depth == 0
60+ && square_brace_depth == 0
61+ && brace_depth == 0
62+ && !in_backticks
63+ && !in_quotes;
5764
5865 match ch {
5966 // NOTE: For now, only odd backtick(s) are handled.
@@ -67,6 +74,11 @@ pub fn parse_jsdoc(
6774 in_backticks = !in_backticks;
6875 }
6976 }
77+ '"' | '\'' => {
78+ if chars. peek ( ) . is_some_and ( |& c| c != ch) {
79+ in_quotes = !in_quotes;
80+ }
81+ }
7082 '{' => curly_brace_depth += 1 ,
7183 '}' => curly_brace_depth = curly_brace_depth. saturating_sub ( 1 ) ,
7284 '(' => brace_depth += 1 ,
0 commit comments