add support for css files reference in html #360

Merged
merged 4 commits into from Mar 29, 2013

Projects

None yet

2 participants

@yifan
yifan commented Mar 25, 2013
<link rel="stylesheet" href="css.css" type="text/css" />

You can cherry pick this commit:
support css file 2ca40c8

@odrobnik
Collaborator

Please clean up this pull request to only contain your addition. Easiest would probably to make a new branch off master, cherry-pick our commit and send a new pull request from there

Best regards
Oliver Drobnik

@Cocoanetics on Twitter and App.net
www.cocoanetics.com

On 25.03.2013, at 15:24, Yifan Zhang notifications@github.com wrote:

You can cherry pick this commit: support css file 2ca40c8

You can merge this Pull Request by running

git pull https://github.com/yifan/DTCoreText master
Or view, comment on, or merge it at:

#360

Commit Summary

support css file
Improved underline and strike-out drawing.
deprecated method and replaced with one with options bit mask
Added ability to draw links normal or highlighted
Added contentImageWithBounds:options: method
removed text frame drawing on link buttons
[BREAKING] removed custom string drawing from DTLinkButton
restored previous minimum hit size in demo
implemented setting a hyperlink active color
Added unit test for #342
Fixed start index being ignored for OL lists
Added unit test for #358
Ignore !important CSS tag
added test case comment
Made all headers public
added libDTHTMLParser into DTCoreText static framework
Merge remote-tracking branch 'upstream/master'
File Changes

M Core/Source/DTHTMLAttributedStringBuilder.m (16)
M DTCoreText.xcodeproj/project.pbxproj (4)
A Demo/Resources/css.css (28)
M Demo/Resources/styles.html (10)
M Demo/Source/DemoTextViewController.m (2)
Patch Links:

https://github.com/Cocoanetics/DTCoreText/pull/360.patch
https://github.com/Cocoanetics/DTCoreText/pull/360.diff

@yifan
yifan commented Mar 25, 2013

@Cocoanetics pull request is clean now.

@odrobnik
Collaborator

What happens if the base URL is not set? What if it is not a local file? I think you should deal with these situations as well.

@yifan
yifan commented Mar 25, 2013

Very good points. base URL missing will not cause a big problem. Maybe a error message in debugging mode will help. I don't really want to deal with remote files because it may have complication in performance. What's your take on this?

@odrobnik
Collaborator

I think the default for the base URL should be the app bundle resource folder, which in case of iOS is the app bundle, on Mac its the resources subfolder.

I would Ignore the link if the base URL is nil or the scheme is not file:// and log a warning with NSLog.

@yifan
yifan commented Mar 27, 2013

@Cocoanetics url check and warning message are added

@odrobnik
Collaborator

Why not use isFileURL as opposed to checking for file scheme?

@odrobnik odrobnik merged commit 25fa887 into Cocoanetics:master Mar 29, 2013
@odrobnik
Collaborator

Thanks for your work!

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