Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only remove comments <!-- --> #104

Open
Pok4 opened this issue Dec 18, 2024 · 0 comments
Open

Only remove comments <!-- --> #104

Pok4 opened this issue Dec 18, 2024 · 0 comments

Comments

@Pok4
Copy link

Pok4 commented Dec 18, 2024

Im using last version and i want if it possible to hide in source code only comments.
Now im using

$htmlMin->doOptimizeViaHtmlDomParser(true);               // optimize html via "HtmlDomParser()"
	$htmlMin->doRemoveComments(true);                          // remove default HTML comments (depends on "doOptimizeViaHtmlDomParser(true)")
	$htmlMin->doSumUpWhitespace(false);                        // sum-up extra whitespace from the Dom (depends on "doOptimizeViaHtmlDomParser(true)")
	$htmlMin->doRemoveWhitespaceAroundTags(false);             // remove whitespace around tags (depends on "doOptimizeViaHtmlDomParser(true)")
	$htmlMin->doOptimizeAttributes(false);                     // optimize html attributes (depends on "doOptimizeViaHtmlDomParser(true)")
	$htmlMin->doRemoveHttpPrefixFromAttributes(false);         // remove optional "http:"-prefix from attributes (depends on "doOptimizeAttributes(true)")
	$htmlMin->doRemoveHttpsPrefixFromAttributes(false);        // remove optional "https:"-prefix from attributes (depends on "doOptimizeAttributes(true)")
	$htmlMin->doKeepHttpAndHttpsPrefixOnExternalAttributes(false); // keep "http:"- and "https:"-prefix for all external links 
	$htmlMin->doMakeSameDomainsLinksRelative([]); 				// make some links relative, by removing the domain from attributes
	$htmlMin->doRemoveDefaultAttributes(false);                // remove defaults (depends on "doOptimizeAttributes(true)" | disabled by default)
	$htmlMin->doRemoveDeprecatedAnchorName(false);             // remove deprecated anchor-jump (depends on "doOptimizeAttributes(true)")
	$htmlMin->doRemoveDeprecatedScriptCharsetAttribute(false); // remove deprecated charset-attribute - the browser will use the charset from the HTTP-Header, anyway (depends on "doOptimizeAttributes(true)")
	$htmlMin->doRemoveDeprecatedTypeFromScriptTag(false);      // remove deprecated script-mime-types (depends on "doOptimizeAttributes(true)")
	$htmlMin->doRemoveDeprecatedTypeFromStylesheetLink(false); // remove "type=text/css" for css links (depends on "doOptimizeAttributes(true)")
	$htmlMin->doRemoveDeprecatedTypeFromStyleAndLinkTag(false); // remove "type=text/css" from all links and styles
	$htmlMin->doRemoveDefaultMediaTypeFromStyleAndLinkTag(false); // remove "media="all" from all links and styles
	$htmlMin->doRemoveDefaultTypeFromButton(false);            // remove type="submit" from button tags 
	$htmlMin->doRemoveEmptyAttributes(false);                  // remove some empty attributes (depends on "doOptimizeAttributes(true)")
	$htmlMin->doRemoveValueFromEmptyInput(false);              // remove 'value=""' from empty <input> (depends on "doOptimizeAttributes(true)")
	$htmlMin->doSortCssClassNames(false);                      // sort css-class-names, for better gzip results (depends on "doOptimizeAttributes(true)")
	$htmlMin->doSortHtmlAttributes(false);                     // sort html-attributes, for better gzip results (depends on "doOptimizeAttributes(true)")
	$htmlMin->doRemoveSpacesBetweenTags(false);                // remove more (aggressive) spaces in the dom (disabled by default)
	$htmlMin->doRemoveOmittedQuotes(false);                    // remove quotes e.g. class="lall" => class=lall
	$htmlMin->doRemoveOmittedHtmlTags(false);				   // remove ommitted html tags e.g. <p>lall</p> => <p>lall 

but this configuration has make changes to source code, not hiding only comments. I want to not touch the source code, only hide comments.
If this is possible ?
Thanks...

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

No branches or pull requests

1 participant