Collapsible code blocks and clickable URLs

Collapse source ranges into expandable summaries and turn HTTP links into clickable references in exported HTML.

Collapsible code blocks and clickable URLs

Screenshots show the English interface; controls are available in your selected website language.

Collapse a source range

In Folding and links, enter 20-25 under Collapsed sections. The first line remains visible as a summary; subsequent lines are hidden until the reader expands it. A single selected line is left as a normal line because there is no remaining content to hide. Adjacent selected ranges form one continuous fold.

Collapsed code summary with its expand control

The Collapse label is appended to the summary; it defaults to … and accepts up to 80 characters. Click the summary or activate it with the keyboard to expand and collapse the preview. Generated HTML uses native details and summary elements, so folding does not need a JavaScript runtime on the destination page.

Expanded code section revealing the helper function body

Expanding the preview is a local viewing action. Downloaded HTML is regenerated from configuration and starts folded; PNG captures the current visible expansion state. Folded content remains in the HTML and is not private or removed.

Enable Autolink URLs. The renderer links http://, https:// and www. text, including URLs split across syntax tokens. It does not require a URL to be in a comment. Common trailing sentence punctuation is trimmed from the destination. A www. address is opened using HTTPS.

Links open in a new tab with noopener noreferrer nofollow. Other protocols are not activated, and email addresses are not automatically converted to mail links. Turning this setting off restores plain code text. Autolinking changes presentation, not the source.

Combining folding with other effects

Fold summaries retain the first line's syntax coloring, numbering and line effects. Ranges continue to refer to original source positions even when content is hidden. Use the complete demo to check folding alongside numbering and focus.

Open the code highlighter · All guides · Articles and comparisons