Home / Function/ findExtraParagraphUnderHtml() — astro Function Reference

findExtraParagraphUnderHtml() — astro Function Reference

Architecture documentation for the findExtraParagraphUnderHtml() function in html-token-transform.ts from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  d4c791f9_288b_c18a_7009_bcc35ee52e42["findExtraParagraphUnderHtml()"]
  b514e53d_6f58_26e2_b444_6fdf850f8be2["html-token-transform.ts"]
  d4c791f9_288b_c18a_7009_bcc35ee52e42 -->|defined in| b514e53d_6f58_26e2_b444_6fdf850f8be2
  ae279694_8174_cef4_9b86_503e9ce07415["mutateAndCollapseExtraParagraphsUnderHtml()"]
  ae279694_8174_cef4_9b86_503e9ce07415 -->|calls| d4c791f9_288b_c18a_7009_bcc35ee52e42
  30920b8b_e40d_ddeb_c282_b087fed00691["isExtraParagraphPatternMatch()"]
  d4c791f9_288b_c18a_7009_bcc35ee52e42 -->|calls| 30920b8b_e40d_ddeb_c282_b087fed00691
  style d4c791f9_288b_c18a_7009_bcc35ee52e42 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/markdoc/src/html/transform/html-token-transform.ts lines 201–220

function findExtraParagraphUnderHtml(tokens: Token[]): number | null {
	if (tokens.length < 5) {
		return null;
	}

	for (let i = 0; i < tokens.length; i++) {
		const last = i + 4;
		if (last > tokens.length - 1) {
			break; // early exit, no more possible 5-long slices to search
		}

		const slice = tokens.slice(i, last + 1);
		const isMatch = isExtraParagraphPatternMatch(slice);
		if (isMatch) {
			return i;
		}
	}

	return null;
}

Domain

Subdomains

Frequently Asked Questions

What does findExtraParagraphUnderHtml() do?
findExtraParagraphUnderHtml() is a function in the astro codebase, defined in packages/integrations/markdoc/src/html/transform/html-token-transform.ts.
Where is findExtraParagraphUnderHtml() defined?
findExtraParagraphUnderHtml() is defined in packages/integrations/markdoc/src/html/transform/html-token-transform.ts at line 201.
What does findExtraParagraphUnderHtml() call?
findExtraParagraphUnderHtml() calls 1 function(s): isExtraParagraphPatternMatch.
What calls findExtraParagraphUnderHtml()?
findExtraParagraphUnderHtml() is called by 1 function(s): mutateAndCollapseExtraParagraphsUnderHtml.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free