Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Shortcut for MarkupString parser #18

Closed
malcommac opened this issue Jul 6, 2017 · 0 comments
Closed

Shortcut for MarkupString parser #18

malcommac opened this issue Jul 6, 2017 · 0 comments
Assignees
Milestone

Comments

@malcommac
Copy link
Owner

Add a new func to String instances which allows you to parse a tagged (html-like) string and return the NSMutableAttributed string.

It will be called renderTags(withStyles:).

Follows an example:

let sourceTaggedString = "<center>The quick brown fox</center>\njumps over the lazy dog is an <italic>English-language</italic> pangram—a phrase that contains <italic>all</italic> of the letters of the alphabet. It is <extreme><underline>commonly</underline></extreme> used for touch-typing practice."
let _ = sourceTaggedString.renderTags(withStyles: [tag_center,tag_italic,tag_extreme,tag_underline])
@malcommac malcommac added this to the 0.9.9 milestone Jul 6, 2017
@malcommac malcommac self-assigned this Jul 6, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant