sapegin/richtypo.js

Add/mention option for UTF nbsps in Readme

kizu opened this issue · 5 comments

kizu commented

I tried the example from the readme and thought it didn't work, as the output had UTF nbsps —  , but Readme had escaped HTML ones —  .

Is there an option for setting the output to html-escaped one? If not, then it should be mentioned in Readme, so people won't confuse when they won't see the escaped nbsps in their result.

There’s not such option because generation of   is useless ;-) Could you send a PR because I don’t see a good place where I can mention that?

IMO, using   would be much clearer than the non-breaking space itself. Otherwise, it causes confusion. The doc says that:

var beautiful = richtypo.rich('Welcome to the world');

Will produce something like that:

Welcome to the world

But actually it does not produce  , so it looks like the library is not working.

Yeah, docs could be better. But there’s really no point (except for debugging purposes) in generating actual  s instead of non-breaking spaces.

Anyway docs improvements or PRs/suggestions on how I can improve the library are welcomed.

Ease of debugging and testing are valid reasons by themselves, why not consider them? Sure,   is 5 characters longer and less readable, but who cares anyway. The raw output is not for human to read.

Closing this issue in favour of #13.