Live data from Hacker News

Show HN: MapChat – A simple location based chat in 300 lines of code

idoco.github.io

41–50 of 122 posts

Re: Show HN: MapChat – A simple location based chat in 300 lines of code

#42
post #39

What's the name of the russian sounding song that someone injected? I've been searching it for ages!

Loituma - Ievan Polkka

Thanks! I want to say I love you but I will only say that I wanted to say it :P

Re: Show HN: MapChat – A simple location based chat in 300 lines of code

#48
post #28
post #26

Earlier quoted context omitted.

I think it is now somewhat disabled. you just need to refresh the page.

This is what I did for now msg.text = msg.text.replace('>','') .replace(' I will think of a more clever solution next week :)

Here is how mustache.js[0] does it:

    var entityMap = {
        "&": "&",
        "": ">",
        '"': '"',
        "'": ''',
        "/": '/'
     };

      function escapeHtml(string) {
        return String(string).replace(/[&"'\/]/g, function (s) {
          return entityMap[s];
        });
      }


also document.createTextNode will tell the browser not to render the children as html, whereas appending a dom element and innerHTML will.[1] I'm just assuming that behavior is correct in all browsers though.

[0]https://github.com/janl/mustache.js/blob/master/mustache.js#...

[1]https://jsfiddle.net/1dsygwoj/

Re: Show HN: MapChat – A simple location based chat in 300 lines of code

#49
post #28
post #26

Earlier quoted context omitted.

I think it is now somewhat disabled. you just need to refresh the page.

This is what I did for now msg.text = msg.text.replace('>','') .replace(' I will think of a more clever solution next week :)

That's super easy to get around. It only replaces the first occurrence of each.
Post reply on HN