MCPcopy Create free account
hub / github.com/ChinaSiro/claude-code-sourcemap / blockquote

Method blockquote

package/cli.js:1416–1427  ·  view source on GitHub ↗
(q)

Source from the content-addressed store, hash-verified

1414`).map(($)=>{let A=$.match(_.other.beginningSpace);if(A===null)return $;let[O]=A;if(O.length>=Y.length)return $.slice(Y.length);return $}).join(`
1415`)}class Yr6{options;rules;lexer;constructor(q){this.options=q||SO6}space(q){let K=this.rules.block.newline.exec(q);if(K&&K[0].length>0)return{type:"space",raw:K[0]}}code(q){let K=this.rules.block.code.exec(q);if(K){let _=K[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:K[0],codeBlockStyle:"indented",text:!this.options.pedantic?Kr6(_,`
1416`):_}}}fences(q){let K=this.rules.block.fences.exec(q);if(K){let _=K[0],z=cd_(_,K[3]||"",this.rules);return{type:"code",raw:_,lang:K[2]?K[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):K[2],text:z}}}heading(q){let K=this.rules.block.heading.exec(q);if(K){let _=K[2].trim();if(this.rules.other.endingHash.test(_)){let z=Kr6(_,"#");if(this.options.pedantic)_=z.trim();else if(!z||this.rules.other.endingSpaceChar.test(z))_=z.trim()}return{type:"heading",raw:K[0],depth:K[1].length,text:_,tokens:this.lexer.inline(_)}}}hr(q){let K=this.rules.block.hr.exec(q);if(K)return{type:"hr",raw:Kr6(K[0],`
1417`)}}blockquote(q){let K=this.rules.block.blockquote.exec(q);if(K){let _=Kr6(K[0],`
1418`).split(`
1419`),z="",Y="",$=[];while(_.length>0){let A=!1,O=[],w;for(w=0;w<_.length;w++)if(this.rules.other.blockquoteStart.test(_[w]))O.push(_[w]),A=!0;else if(!A)O.push(_[w]);else break;_=_.slice(w);let j=O.join(`
1420`),H=j.replace(this.rules.other.blockquoteSetextReplace,`
1421 $1`).replace(this.rules.other.blockquoteSetextReplace2,"");z=z?`${z}
1422${j}`:j,Y=Y?`${Y}
1423${H}`:H;let J=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(H,$,!0),this.lexer.state.top=J,_.length===0)break;let M=$.at(-1);if(M?.type==="code")break;else if(M?.type==="blockquote"){let X=M,P=X.raw+`
1424`+_.join(`
1425`),W=this.blockquote(P);$[$.length-1]=W,z=z.substring(0,z.length-X.raw.length)+W.raw,Y=Y.substring(0,Y.length-X.text.length)+W.text;break}else if(M?.type==="list"){let X=M,P=X.raw+`
1426`+_.join(`
1427`),W=this.list(P);$[$.length-1]=W,z=z.substring(0,z.length-M.raw.length)+W.raw,Y=Y.substring(0,Y.length-X.raw.length)+W.raw,_=P.substring($.at(-1).raw.length).split(`
1428`);continue}}return{type:"blockquote",raw:z,tokens:$,text:Y}}}list(q){let K=this.rules.block.list.exec(q);if(K){let _=K[1].trim(),z=_.length>1,Y={type:"list",raw:"",ordered:z,start:z?+_.slice(0,-1):"",loose:!1,items:[]};if(_=z?`\\d{1,9}\\${_.slice(-1)}`:`\\${_}`,this.options.pedantic)_=z?_:"[*+-]";let $=this.rules.other.listItemRegex(_),A=!1;while(q){let w=!1,j="",H="";if(!(K=$.exec(q)))break;if(this.rules.block.hr.test(q))break;j=K[0],q=q.substring(j.length);let J=K[2].split(`
1429`,1)[0].replace(this.rules.other.listReplaceTabs,(f)=>" ".repeat(3*f.length)),M=q.split(`
1430`,1)[0],X=!J.trim(),P=0;if(this.options.pedantic)P=2,H=J.trimStart();else if(X)P=K[1].length+1;else P=K[2].search(this.rules.other.nonSpaceChar),P=P>4?1:P,H=J.slice(P),P+=K[1].length;if(X&&this.rules.other.blankLine.test(M))j+=M+`

Callers 2

blockTokensMethod · 0.45
parseMethod · 0.45

Calls 10

listMethod · 0.95
Kr6Function · 0.85
blockTokensMethod · 0.80
execMethod · 0.45
testMethod · 0.45
pushMethod · 0.45
sliceMethod · 0.45
joinMethod · 0.45
replaceMethod · 0.45
atMethod · 0.45

Tested by

no test coverage detected