WebOptimizer icon indicating copy to clipboard operation
WebOptimizer copied to clipboard

Add processor to extract plain text from html

Open trialotto opened this issue 7 years ago • 5 comments

It would be nice to add processors for Uglify.HtmlToText(), as present in NUglify v1.5.8.

Any thoughts about this?

Furthermore, NUglify can cause some performance issues in comparison to other minifiers.

Any thoughts on the latter? Is support of other minifiers to be expected?

Kind regards...

PS Despite of the questions, I really like this solution due to the fact that it is easy in use and, even more important, a crystal clear "total package" (as opposed to many other projects or packages). Thanks!

trialotto avatar Nov 04 '17 02:11 trialotto

Such a processor would be easy to write if NUglify already has the method available. You can use any other minifiers including node.js based ones by using the WebOptimizer.NodeServices base classes. That's similar to what AutoPrefixer and LESS compiler does.

madskristensen avatar Nov 08 '17 16:11 madskristensen

...btw, what is the use case for "Extract text from HTML"?

madskristensen avatar Nov 08 '17 20:11 madskristensen

@madskristensen

NUglify should have the method available, see Features on https://github.com/xoofx/NUglify.

The purpose and/or use case would be (amongst others)

  • mail related purposes: html formatted & plain text formats (for instance, consider SendGrid use cases)
  • content management: simple editors to change plain text within html markup
  • better, faster and more easy pdf parsing

and so on.

By the way, in your AspNetCoreTemplatePack, you add a gulp based approach in the MVC Fast template.

And I was wondering why LigerShark.WebOptimizer is not used in those templates.

Can you explain a bit?

Regards......

trialotto avatar Nov 09 '17 04:11 trialotto

Thanks for clarifying, but I'm not sure I understand the use case. When do you want to render an email in the browser in clear text?

The reason for Gulp in the template pack is that I haven't updated it to use WebOptimizer yet. I built the template pack long before I build WebOptimizer :)

madskristensen avatar Nov 09 '17 16:11 madskristensen

@madskristensen

Let's leave the "extract plain text from html" for what it is.

It might be more interesting to focus on the integration of WebOptimizer in the template pack.

In essence, the importance is related to the fact that one should not want a whole lot of (nuget) packages in a project: it is very inconvenient and there often is a lot of overlap.

And, it seems to be the case that WebOptimizer is a perfect candidate for minification purposes.

Certainly would prevent the usage of gulp.

Regards.........

trialotto avatar Nov 09 '17 19:11 trialotto