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

*Blacklisting* certain attributes #80

Open
worldspawn opened this issue Jan 22, 2014 · 4 comments
Open

*Blacklisting* certain attributes #80

worldspawn opened this issue Jan 22, 2014 · 4 comments
Milestone

Comments

@worldspawn
Copy link
Contributor

Hey, I've noticed there is some odd behaviour to do with ol/ul lists and content with align=left on it. This has been observed in ie9 only. To reproduce paste in the following HTML

<p><strong>In hac habitasse platea dictumst.</strong> Vestibulum et dapibus ligula. Aliquam turpis augue, aliquam ut justo sit amet, facilisis viverra neque. Aenean porta tellus dolor. Nunc eget magna ut metus <u>viverra fermentum sed sit amet</u> nulla. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Ut scelerisque pretium felis, sit amet fermentum nibh posuere <em>id. In eros dolor</em>, consectetur non nisi eget, egestas semper elit. Aliquam quis commodo felis. Phasellus non sem id est bibendum tristique. Etiam bibendum felis eu ligula commodo rutrum. Duis felis ipsum, posuere imperdiet nibh ut, scelerisque ornare erat.</p><ol><li><div align="left"></li></ol>

The cursor after the first li sits below the number. This content was originally pasted in from word and I was wondering if textangular provided a facility to ward against specific tags and attributes. In this case i'd like it to remove all "align" attributes.

@SimeonC
Copy link
Collaborator

SimeonC commented Jan 27, 2014

Currently, no it doesn't. I'll look into this though as there's probably something we can do here about standardising the way execCommand uses some commands like align. See #82 and #68. Though I probably can only change this in 1.2.0 due to my fork of angular-sanitize that allows specific santised style tags - depending on how my testing goes.

SimeonC pushed a commit that referenced this issue Feb 5, 2014
Added Rangy as Optional library - Gives better activeState selection and more flexibility to tools plugins. Completely optional.
taBind and taSanitize tests #33
Fixed the use of ‘align’ attribute which is supposed to be depreciated in HTML5, changed to add in ‘text-align’ style as valid attribute. issue highlighted from #80
Update model on cut/paste #79
Add in some toolbar focus fixes from test cases.
Moved a lot of for loops to anglular.forEach as it’s tidier.
@SimeonC
Copy link
Collaborator

SimeonC commented Mar 3, 2014

As an aside, I looked around and the align attribute apparently is depreciated for this use, I've modified textAngular to automatically strip out align tags and replace with corresponding style attribute in v1.2.0. No idea how we'd do blacklisting by implementation though.

I have some ideas but I'm a bit hesitant to rewrite large amounts of the angular-sanitize code just at the moment.

@SimeonC
Copy link
Collaborator

SimeonC commented Apr 1, 2014

Quick update on this, I've seen a PR across on the angular.js repo that will do custom whitelisting.
Issue: angular/angular.js#5900
PR: angular/angular.js#6252

I think I'll push this out till they add that in which probably will be in Angular 1.3.0 which means I'll have to do a textAngular 1.3.0 to match, posssibly.

@SimeonC
Copy link
Collaborator

SimeonC commented Feb 1, 2015

Just to say I am watching this, editing textAngular-sanitize is starting to be the most pressing pain point in textAngular so I think I'll have to do something myself (then maybe submit a PR to the main repo)

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

No branches or pull requests

2 participants