mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-21 17:27:54 +00:00
fix(core): Skip loop check for dividers (#6893)
This commit is contained in:
@@ -169,8 +169,16 @@ export class LoopDetectionService {
|
||||
/(^|\n)\s*[*-+]\s/.test(content) || /(^|\n)\s*\d+\.\s/.test(content);
|
||||
const hasHeading = /(^|\n)#+\s/.test(content);
|
||||
const hasBlockquote = /(^|\n)>\s/.test(content);
|
||||
const isDivider = /^[+-_=*\u2500-\u257F]+$/.test(content);
|
||||
|
||||
if (numFences || hasTable || hasListItem || hasHeading || hasBlockquote) {
|
||||
if (
|
||||
numFences ||
|
||||
hasTable ||
|
||||
hasListItem ||
|
||||
hasHeading ||
|
||||
hasBlockquote ||
|
||||
isDivider
|
||||
) {
|
||||
// Reset tracking when different content elements are detected to avoid analyzing content
|
||||
// that spans across different element boundaries.
|
||||
this.resetContentTracking();
|
||||
@@ -179,7 +187,7 @@ export class LoopDetectionService {
|
||||
const wasInCodeBlock = this.inCodeBlock;
|
||||
this.inCodeBlock =
|
||||
numFences % 2 === 0 ? this.inCodeBlock : !this.inCodeBlock;
|
||||
if (wasInCodeBlock || this.inCodeBlock) {
|
||||
if (wasInCodeBlock || this.inCodeBlock || isDivider) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user