jonschlinkert / remarked

No longer maintained, see remarkable instead!
https://github.com/jonschlinkert/remarkable/
MIT License
6 stars 1 forks source link

Extended typographers support #8

Closed outring closed 10 years ago

outring commented 10 years ago

smartypants option is too simple and works well only with english language (i.e. other languages have different rules for quotes, etc.). So it would be great to have an option for custom typographer.

Important note: for russian language is important to know if we are at the beginning of sentence or not. To deal with it would be enough to pass a flag that we are at the beginning of block-level block .

I can implement it myself and make a pull request, but I'm not sure about how option should be passed (I mean, would it be another option, that have no deal with smartypants, or just function-value for smartypants).

What do you think?

jonschlinkert commented 10 years ago

would it be another option, that have no deal with smartypants, or just function-value for smartypants

hmm, it might make sense to do both. e.g. add another method to the lexer, somewhere before or after the smartypants regex, then add whatever logic is required here or wherever it makes sense. I'm not sure how extensive this would be yet.

I'm definitely in favor of making this more inclusive of other languages, so a pr would be great. would be great to have a few unit tests too. you could copy the smartypants tests or create new ones. feel free to implement the tests however you want. thanks!

outring commented 10 years ago

Yes, I've already done something like that. Will use separate option for now.