Skip to content

feat(transformers): add transformerRemoveEmptyLines#1265

Open
VeerShah41 wants to merge 1 commit intoshikijs:mainfrom
VeerShah41:feat/transformer-remove-empty-lines
Open

feat(transformers): add transformerRemoveEmptyLines#1265
VeerShah41 wants to merge 1 commit intoshikijs:mainfrom
VeerShah41:feat/transformer-remove-empty-lines

Conversation

@VeerShah41
Copy link
Copy Markdown

Adds a new transformer that filters out empty and
whitespace-only lines from the highlighted code token output.

This is useful when rendering code blocks that come from template literals with leading/trailing blank lines, or when the source snippet contains blank separators that clutter the rendered output.

Options:
removeWhitespaceOnlyLines (default: true) — also removes
lines whose tokens contain only whitespace characters.

Closes #1206

  • <- Keep this line and put an x between the brackts.

Description

Linked Issues

fixes #

Additional context

Adds a new transformer that filters out empty and
whitespace-only lines from the highlighted code token output.

This is useful when rendering code blocks that come from
template literals with leading/trailing blank lines, or when
the source snippet contains blank separators that clutter
the rendered output.

Options:
  removeWhitespaceOnlyLines (default: true) — also removes
  lines whose tokens contain only whitespace characters.

Closes shikijs#1206
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 19, 2026

Deploy Preview for shiki-matsu ready!

Name Link
🔨 Latest commit ec4720e
🔍 Latest deploy log https://app.netlify.com/projects/shiki-matsu/deploys/69bc15b505d02c00080779ab
😎 Deploy Preview https://deploy-preview-1265--shiki-matsu.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Mar 19, 2026

Deploy Preview for shiki-next ready!

Name Link
🔨 Latest commit ec4720e
🔍 Latest deploy log https://app.netlify.com/projects/shiki-next/deploys/69bc15b5bf4fb1000854481a
😎 Deploy Preview https://deploy-preview-1265--shiki-next.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add transformer-remove-empty-lines

1 participant