Giter VIP home page Giter VIP logo

string-additions-for-html's Introduction

NSAttributedString HTML Additions

This project aims to duplicate the methods present on Mac OSX which allow creation of NSAttributedString from HTML code on iOS.

This is useful for drawing simple rich text like any HTML document without having to use a UIWebView.

Features

At present the following tags are supported:

  • Headers H1 - H6
  • Paragraphs: P
  • Bold: B, STRONG
  • Italic: I, EM
  • Underline: U
  • Superscript: SUP
  • Subscript: SUB, e.g. e = mc2
  • Styling: FONT (face and color, not size). It would be great if we could support many more styles
  • Unordered Lists: UL, LI
  • Ordered Lists: OL, LI

Currently attributes are inherited by enclosed tags via 'brute force'. I don't know if this is accurate.

To Do

NSAttributedString+HTML

  • Decode HTML Entities
  • A HREF tags, to format links
  • More styles, as far as supported by CoreText

DTAttributedTextView

  • Caret Positioning
  • Hit Detection on strings attributed with HREF
  • Text Insertion
  • Editing!

There is still quite a few more things to do on the project. DEL, possibly CSS styles as they related to fonts and text formatting.

Please Help!

If you find brief test cases where the created NSAttributedString differs from the version on OSX please send them to us!

Follow @cocoanetics on Twitter.

string-additions-for-html's People

Contributors

ivgalic avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.