Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Retrieving NSAttributedString objects instead of NSString objects. #60

DAloG opened this Issue · 5 comments

2 participants


As soon as lib allow user apply uppercase() filter, why not allow bold() filter or something with string atttributes. Or there is some way to retrieve range of replaced values, and apply dictionary by hands, outside of the lib?


Hi DAloG, that's quite a valid request, thanks.

I can't think of any way to achieve it, right now: there is no NSAttributedString support, and no way to extract ranges of rendered values, as you suggest.

Right now, you can look at and you could render HTML with Mustache, and use those libraries to build attributed strings.

What do you think?


Hi @groue, i tried to look at custom render objects. I hope i can extract previous rendered string to catch start location of result string. Inside custom rendering objects i can edit an instance of NSMutableDictionary to store all ranges with appropriate attributes.
What do you think about this approach?


Custom rendering objects don't know when and where they are rendered, and there is no callback for the rendering of template filling text. For instance, when rendering prefix{{ tag }}, there is no API any object attached to tag could use to know the length of the prefix. I don't see how you could implement your ideas with the current API.



Do you know NSHTMLTextDocumentType? It may help: you first have GRMustache produce HTML, and another tool (here, a system one), turns this HTML into an attributed string.


Let's close this issue. Mustache is a raw-text-processing tool, after all.

@groue groue closed this
@groue groue added the won't fix label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.