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

class and style attribute stripping #19

Closed
SimeonC opened this issue Nov 13, 2013 · 1 comment
Closed

class and style attribute stripping #19

SimeonC opened this issue Nov 13, 2013 · 1 comment

Comments

@SimeonC
Copy link
Collaborator

SimeonC commented Nov 13, 2013

In the current implementation this line in the compileHtml function strips out all class and style attributes.

var compHtml = angular.element("<div>").append(html).html().replace(/(class="(.*?)")|(class='(.*?)')/g, "").replace(/&lt;/g, "<").replace(/&gt;/g, ">").replace(/style=("|')(.*?)("|')/g, "");

To me this seems a little too draconian as it means that if I am in raw html view I can't use something like: <p class='highlight'></p> as the class attribute is stripped out. This seems a little counterproductive to my mind, what was the reasoning behind this?

@fraywing
Copy link
Collaborator

The primary reason for not supporting attributes (primarily the style attribute) is the fact that chrome currently adds some superficial line-height properties to various elements.

Since we cannot easily discern which of these are added at what given time, I've decided to remove the ability entirely.

See #5 for details.

SimeonC pushed a commit to SimeonC/textAngular that referenced this issue Dec 5, 2013
…r#30, textAngular#19

Updates the fix introduced in textAngular#5 to be more specific and less of a catch all.
Changed version to v1.1.2
netbubu17 pushed a commit to netbubu17/textAngular that referenced this issue Dec 19, 2013
…r#30, textAngular#19

Updates the fix introduced in textAngular#5 to be more specific and less of a catch all.
Changed version to v1.1.2
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

2 participants