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

Default CSS style sheet added / don't lowercase CSS selectors #85

Merged
merged 4 commits into from
Dec 2, 2011

Conversation

sbeigel
Copy link
Contributor

@sbeigel sbeigel commented Nov 28, 2011

I've added an option to (re-)use a (default) DTCSSStylesheet object which is useful if you have a lot of (small) HTML strings using a common set of CSS classes. It is set as an option with the key DTDefaultStyleSheet on NSAttributedString initWithHTML:options:documentAttributes:.

Another change contained in this pull request is the removal of the lowercase conversion of CSS selectors. I don't understand the reason -- using camel (or any) cased CSS selectors (classes) is quite common and I don't see why you should have to adjust your stylesheets for NSAS+HTML as it makes reusing existing HTML (and CSS) harder.

@odrobnik
Copy link
Collaborator

odrobnik commented Dec 1, 2011

Please update from latest master because I can not merge this pull request.

@sbeigel
Copy link
Contributor Author

sbeigel commented Dec 2, 2011

I'm not sure about adding the list styles to the default stylesheet -- maybe this should be done to the newly created one only. At least they should not be added multiple times to the given default stylesheet...

- init with a given style sheet to start with these style
- merge (later) a given style sheet's styles into this style sheet
If passed as option, merge the default style sheet's styles into the combined style sheet for the document
@sbeigel
Copy link
Contributor Author

sbeigel commented Dec 2, 2011

Like this?

@odrobnik
Copy link
Collaborator

odrobnik commented Dec 2, 2011

Yes, did you test it, set different default List styles in option?

Von meinem iPhone gesendet

Am 02.12.2011 um 09:38 schrieb Sebastian Beigel reply@reply.github.com:

Like this?


Reply to this email directly or view it on GitHub:
https://github.com/Cocoanetics/NSAttributedString-Additions-for-HTML/pull/85#issuecomment-2987646

@sbeigel
Copy link
Contributor Author

sbeigel commented Dec 2, 2011

Yep, ul {list-style: none;} in my default style sheet (passed as option) overrides the "disc" list-style.

odrobnik added a commit that referenced this pull request Dec 2, 2011
Default CSS style sheet added / don't lowercase CSS selectors
@odrobnik odrobnik merged commit d5438f6 into Cocoanetics:master Dec 2, 2011
@odrobnik
Copy link
Collaborator

odrobnik commented Dec 2, 2011

Thank you for your contribution! I merged it.

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

Successfully merging this pull request may close these issues.

2 participants