Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
danielrw7
on Feb 7, 2016
|
parent
|
context
|
favorite
| on:
Show HN: Ascii Art to Data URI
This bit is great:
box = box.replace(/#/g, function() { i++ if (str[i]) { return str[i] } else { return ""; } });
It would be cool if you could select which characters (or all characters except for space) will be replaced with the data URI.
yorwba
on Feb 7, 2016
[–]
Just replace that /#/g with /[^\s]/g to replace all non-whitespace characters.
aehtyb
on Feb 11, 2016
|
parent
|
next
[–]
be forewarned that the reason it's asking you to use only #'s and spaces is the effect only works if the ascii image is very contrast-y. if the ascii art makes use of gradients (....:::;;;iiii@@@@) the effect won't be as obvious or work at all.
skeoh
on Feb 8, 2016
|
parent
|
prev
[–]
Does [^\s] match anything \S doesn't?
Consider applying for YC's W25 batch! Applications are open till Nov 12.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: