8000 Minify code wich contain backtick (`) as delimiter issue · Issue #892 · tdewolff/minify · GitHub
[go: up one dir, main page]

Skip to content

Minify code wich contain backtick (`) as delimiter issue #892

Open

Description

@laurfb

Hi.
Some trouble trying to minify html code with some js code inside which use backtick ( ` ) as delimiter.
Like in example below:

<html>
....
	<body>
	....
		<script>
		....
				this.container.innerHTML = `
					<div class="player-wrapper">
						<div class="player-controls hidden">
							<select class="stream-selector">
								<option value="">Please select a stream!</option>
							</select>
							<button class="load-stop-btn">Play</button>
						</div>
						<div class="status-overlay"></div>
						<video class="player-video" autoplay controls></video>
						<div class="peak-meter-container">
							<div class="meters-wrapper"></div>
							<div class="db-scale"></div>
						</div>
					</div>
				`;
		....
		</script>
	....
	</body>
</html>

After minify the code block between backtick (`) delimiters remain completely untouched.
What can be done?
Use CLI binnaries for Windows.

regards,
Laur

Activity

  1. tdewolff commented on Jan 10, 2026

    @tdewolff
    Owner

    There is no minification of HTML parts within JS since this is not a straightforward task. Your example is quite a clear case we could support, but what if we assign to innerHTML various concatenations of strings and variables? The general case is not feasible. I will keep the issue open as a non-urgent feature request, thanks for posting!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0