cgiffard / Downsize

Tag safe text truncation for HTML and XML!
BSD 3-Clause "New" or "Revised" License
41 stars 13 forks source link

create a system to count by blocks #12

Closed adam-zethraeus closed 10 years ago

adam-zethraeus commented 10 years ago

status quo:

suggested addition:

Intended as a generic version of paragraphs:5 or something, but that could be added as a good shortcut too.

What do you think?

cgiffard commented 10 years ago

I'm wondering whether a lot of this functionality might be serviced by a custom count function, like so:

downsize("...", function(token, stack, ...) {
    return true/false;
});

(Or perhaps the function would be better passed in through the options object.)

adam-zethraeus commented 10 years ago

Would this be as a substitute for actually implementing the functionality in downsize? I guess it becomes a matter of you choosing the scope of the project then!

cgiffard commented 10 years ago

I also think giving downsize a better comprehension of the underlying HTML might make custom handling a little easier.

I'm going to add some contribution guidelines and make sure the documentation is clear — but once that's done, could I give you push access to this repo?

adam-zethraeus commented 10 years ago

That'd be awesome.

cgiffard commented 10 years ago

@zethraeus Does contextual tags satisfy this issue, or is there a deeper requirement here?

adam-zethraeus commented 10 years ago

satisfies. thanks for pointing it out