question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem with the content of the html attributes

See original GitHub issue

I am having trouble minifying a page that contains the following code:

<img alt="Vínculo al registro detallado" id="hover_1151553" class="item-image defer-image|http://www.example.com/rpsweb/othumb?id=NL$1151553$PDF&s=e" data-dialog='{"isHover":true,"isShowVerticalPopups":true,"container":"#hover","url":"Carousel/Hover","dialogClass":"epdialog preview-hoverdialog","width":340,"data":{"title":"Ecografía en medicina intensiva","author":"Lumb, Philip D.","publisher":"Elsevier","isebook":true,"isabook":false,"iteman":"1151553","itemdb":"nlebk","itemtag":"AN","itemdoid":"NL$1151553$PDF","hoverid":"hover_1151553","downloadable":true}}' />

When minifying it replaces some characters, for example the character “|” by " ", from the content of the attribute “class”

<img alt="Vínculo al registro detallado" id=hover_1151786 class="item-image defer-image http://www.example.com/rpsweb/othumb?id=NL$1151786$PDF&amp;s=e" data-dialog="{&#34;isHover&#34;:true,&#34;isShowVerticalPopups&#34;:true,&#34;container&#34;:&#34;#hover&#34;,&#34;url&#34;:&#34;Carousel/Hover&#34;,&#34;dialogClass&#34;:&#34;epdialog preview-hoverdialog&#34;,&#34;width&#34;:340,&#34;data&#34;:{&#34;title&#34;:&#34;Stevens y Lowe. Histología humana + StudentConsult&#34;,&#34;author&#34;:&#34;Lowe, J. S.&#34;,&#34;publisher&#34;:&#34;Elsevier&#34;,&#34;isebook&#34;:true,&#34;isabook&#34;:false,&#34;iteman&#34;:&#34;1151786&#34;,&#34;itemdb&#34;:&#34;nlebk&#34;,&#34;itemtag&#34;:&#34;AN&#34;,&#34;itemdoid&#34;:&#34;NL$1151786$PDF&#34;,&#34;hoverid&#34;:&#34;hover_1151786&#34;,&#34;downloadable&#34;:true}}">

The settings currently are as follows:

HtmlMinificationSettings settings = options.MinificationSettings;
settings.RemoveRedundantAttributes = true;
 settings.RemoveHttpProtocolFromAttributes = false;
 settings.RemoveHttpsProtocolFromAttributes = false;
 settings.RemoveHtmlComments = false;
options.CssMinifierFactory = new NUglifyCssMinifierFactory();
 options.JsMinifierFactory = new CrockfordJsMinifierFactory();

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Taritsyncommented, Jul 3, 2020

In version 2.8.6, I improved a performance of the class directive processing.

1reaction
germanyesidcommented, Jul 1, 2020

@Taritsyn Thank you very much, I have updated it and it works fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

what happens when we include wrong attributes in html ...
1. For HTML, a browser just doesn't do anything 'special' with them, effectively ignoring unknown attributes. That is all. · The html parser ......
Read more >
Handling common HTML and CSS problems - MDN Web Docs
HTML fallback behavior​​ Some problems can be solved by just taking advantage of the natural way in which HTML/CSS work. Unrecognized HTML ...
Read more >
HTML Attributes
All HTML elements can have attributes · Attributes provide additional information about elements · Attributes are always specified in the start tag ·...
Read more >
Those HTML Attributes You Never Use
In this article, Louis Lazaris describes and demonstrates some interesting HTML attributes that you may or may not have heard of and perhaps ......
Read more >
The Actual Browser Problems with Unquoted Attributes
The problem characters are: spaces, tabs, line feeds, form feeds, carriage returns, “, ', `, =, <, or >.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found