{"action":"created","comment":{"url":"https://api.github.com/repos/weavejester/hiccup/pulls/comments/47438195","id":47438195,"diff_hunk":"@@ -237,8 +241,11 @@\n   (doall (for [expr content]\n            (cond\n             (vector? expr) (compile-element expr)\n+            (string? expr) `(escape-html ~expr)","path":"src/hiccup/compiler.clj","position":32,"original_position":32,"commit_id":"0964377c125fc90a6312a9e8daac41b89fc0eed0","original_commit_id":"0964377c125fc90a6312a9e8daac41b89fc0eed0","user":{"login":"weavejester","id":8780,"avatar_url":"https://avatars.githubusercontent.com/u/8780?v=3","gravatar_id":"","url":"https://api.github.com/users/weavejester","html_url":"https://github.com/weavejester","followers_url":"https://api.github.com/users/weavejester/followers","following_url":"https://api.github.com/users/weavejester/following{/other_user}","gists_url":"https://api.github.com/users/weavejester/gists{/gist_id}","starred_url":"https://api.github.com/users/weavejester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weavejester/subscriptions","organizations_url":"https://api.github.com/users/weavejester/orgs","repos_url":"https://api.github.com/users/weavejester/repos","events_url":"https://api.github.com/users/weavejester/events{/privacy}","received_events_url":"https://api.github.com/users/weavejester/received_events","type":"User","site_admin":false},"body":"If you know the expression is a literal string, you can just use `(escape-html expr)` and precompute it. Same for the next line.","created_at":"2015-12-12T23:24:28Z","updated_at":"2015-12-12T23:24:28Z","html_url":"https://github.com/weavejester/hiccup/pull/122#discussion_r47438195","pull_request_url":"https://api.github.com/repos/weavejester/hiccup/pulls/122","_links":{"self":{"href":"https://api.github.com/repos/weavejester/hiccup/pulls/comments/47438195"},"html":{"href":"https://github.com/weavejester/hiccup/pull/122#discussion_r47438195"},"pull_request":{"href":"https://api.github.com/repos/weavejester/hiccup/pulls/122"}}},"pull_request":{"url":"https://api.github.com/repos/weavejester/hiccup/pulls/122","id":53487916,"html_url":"https://github.com/weavejester/hiccup/pull/122","diff_url":"https://github.com/weavejester/hiccup/pull/122.diff","patch_url":"https://github.com/weavejester/hiccup/pull/122.patch","issue_url":"https://api.github.com/repos/weavejester/hiccup/issues/122","number":122,"state":"open","locked":false,"title":"Escape all strings by default","user":{"login":"gyim","id":76000,"avatar_url":"https://avatars.githubusercontent.com/u/76000?v=3","gravatar_id":"","url":"https://api.github.com/users/gyim","html_url":"https://github.com/gyim","followers_url":"https://api.github.com/users/gyim/followers","following_url":"https://api.github.com/users/gyim/following{/other_user}","gists_url":"https://api.github.com/users/gyim/gists{/gist_id}","starred_url":"https://api.github.com/users/gyim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gyim/subscriptions","organizations_url":"https://api.github.com/users/gyim/orgs","repos_url":"https://api.github.com/users/gyim/repos","events_url":"https://api.github.com/users/gyim/events{/privacy}","received_events_url":"https://api.github.com/users/gyim/received_events","type":"User","site_admin":false},"body":"This commit implements issue #114 (Safe HTML by default). It introduces\r\na few breaking changes:\r\n\r\n1. Since all strings are escaped by default, adding HTML markup from\r\nstring literals or expressions will not work. Use `hiccup.util/raw-str`\r\nto prevent these values from being escaped.\r\n\r\n2. `hiccup.util/escape-html`, `hiccup.core/h` and `hiccup.core/html`\r\nreturns a RawString object instead of a String. They can be converted to\r\njava.lang.String with the built-in `str` function.\r\n\r\nNote that unlike `hiccup.util/html`, macros in `hiccup.page` (`html4`,\r\n`html5`, `xhtml`) *still* return a string so that their result can be\r\npassed directly to Ring. In the rare cases when the output is embedded\r\nto another html page (e.g. into an iframe) it should be also tagged with\r\n`hiccup.util/raw-str`.","created_at":"2015-12-12T23:01:54Z","updated_at":"2015-12-12T23:24:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7a0fdc98053670dde213152328d8c1b4dcab9337","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/weavejester/hiccup/pulls/122/commits","review_comments_url":"https://api.github.com/repos/weavejester/hiccup/pulls/122/comments","review_comment_url":"https://api.github.com/repos/weavejester/hiccup/pulls/comments{/number}","comments_url":"https://api.github.com/repos/weavejester/hiccup/issues/122/comments","statuses_url":"https://api.github.com/repos/weavejester/hiccup/statuses/0964377c125fc90a6312a9e8daac41b89fc0eed0","head":{"label":"gyim:master","ref":"master","sha":"0964377c125fc90a6312a9e8daac41b89fc0eed0","user":{"login":"gyim","id":76000,"avatar_url":"https://avatars.githubusercontent.com/u/76000?v=3","gravatar_id":"","url":"https://api.github.com/users/gyim","html_url":"https://github.com/gyim","followers_url":"https://api.github.com/users/gyim/followers","following_url":"https://api.github.com/users/gyim/following{/other_user}","gists_url":"https://api.github.com/users/gyim/gists{/gist_id}","starred_url":"https://api.github.com/users/gyim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gyim/subscriptions","organizations_url":"https://api.github.com/users/gyim/orgs","repos_url":"https://api.github.com/users/gyim/repos","events_url":"https://api.github.com/users/gyim/events{/privacy}","received_events_url":"https://api.github.com/users/gyim/received_events","type":"User","site_admin":false},"repo":{"id":47856440,"name":"hiccup","full_name":"gyim/hiccup","owner":{"login":"gyim","id":76000,"avatar_url":"https://avatars.githubusercontent.com/u/76000?v=3","gravatar_id":"","url":"https://api.github.com/users/gyim","html_url":"https://github.com/gyim","followers_url":"https://api.github.com/users/gyim/followers","following_url":"https://api.github.com/users/gyim/following{/other_user}","gists_url":"https://api.github.com/users/gyim/gists{/gist_id}","starred_url":"https://api.github.com/users/gyim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gyim/subscriptions","organizations_url":"https://api.github.com/users/gyim/orgs","repos_url":"https://api.github.com/users/gyim/repos","events_url":"https://api.github.com/users/gyim/events{/privacy}","received_events_url":"https://api.github.com/users/gyim/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gyim/hiccup","description":"Fast library for rendering HTML in Clojure","fork":true,"url":"https://api.github.com/repos/gyim/hiccup","forks_url":"https://api.github.com/repos/gyim/hiccup/forks","keys_url":"https://api.github.com/repos/gyim/hiccup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gyim/hiccup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gyim/hiccup/teams","hooks_url":"https://api.github.com/repos/gyim/hiccup/hooks","issue_events_url":"https://api.github.com/repos/gyim/hiccup/issues/events{/number}","events_url":"https://api.github.com/repos/gyim/hiccup/events","assignees_url":"https://api.github.com/repos/gyim/hiccup/assignees{/user}","branches_url":"https://api.github.com/repos/gyim/hiccup/branches{/branch}","tags_url":"https://api.github.com/repos/gyim/hiccup/tags","blobs_url":"https://api.github.com/repos/gyim/hiccup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gyim/hiccup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gyim/hiccup/git/refs{/sha}","trees_url":"https://api.github.com/repos/gyim/hiccup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gyim/hiccup/statuses/{sha}","languages_url":"https://api.github.com/repos/gyim/hiccup/languages","stargazers_url":"https://api.github.com/repos/gyim/hiccup/stargazers","contributors_url":"https://api.github.com/repos/gyim/hiccup/contributors","subscribers_url":"https://api.github.com/repos/gyim/hiccup/subscribers","subscription_url":"https://api.github.com/repos/gyim/hiccup/subscription","commits_url":"https://api.github.com/repos/gyim/hiccup/commits{/sha}","git_commits_url":"https://api.github.com/repos/gyim/hiccup/git/commits{/sha}","comments_url":"https://api.github.com/repos/gyim/hiccup/comments{/number}","issue_comment_url":"https://api.github.com/repos/gyim/hiccup/issues/comments{/number}","contents_url":"https://api.github.com/repos/gyim/hiccup/contents/{+path}","compare_url":"https://api.github.com/repos/gyim/hiccup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gyim/hiccup/merges","archive_url":"https://api.github.com/repos/gyim/hiccup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gyim/hiccup/downloads","issues_url":"https://api.github.com/repos/gyim/hiccup/issues{/number}","pulls_url":"https://api.github.com/repos/gyim/hiccup/pulls{/number}","milestones_url":"https://api.github.com/repos/gyim/hiccup/milestones{/number}","notifications_url":"https://api.github.com/repos/gyim/hiccup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gyim/hiccup/labels{/name}","releases_url":"https://api.github.com/repos/gyim/hiccup/releases{/id}","created_at":"2015-12-11T23:41:24Z","updated_at":"2015-12-11T23:41:25Z","pushed_at":"2015-12-12T22:59:22Z","git_url":"git://github.com/gyim/hiccup.git","ssh_url":"git@github.com:gyim/hiccup.git","clone_url":"https://github.com/gyim/hiccup.git","svn_url":"https://github.com/gyim/hiccup","homepage":"http://weavejester.github.com/hiccup","size":414,"stargazers_count":0,"watchers_count":0,"language":"Clojure","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"weavejester:master","ref":"master","sha":"3fd8a03a5da0b010d2698fd7e36f9eb8ffdd271e","user":{"login":"weavejester","id":8780,"avatar_url":"https://avatars.githubusercontent.com/u/8780?v=3","gravatar_id":"","url":"https://api.github.com/users/weavejester","html_url":"https://github.com/weavejester","followers_url":"https://api.github.com/users/weavejester/followers","following_url":"https://api.github.com/users/weavejester/following{/other_user}","gists_url":"https://api.github.com/users/weavejester/gists{/gist_id}","starred_url":"https://api.github.com/users/weavejester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weavejester/subscriptions","organizations_url":"https://api.github.com/users/weavejester/orgs","repos_url":"https://api.github.com/users/weavejester/repos","events_url":"https://api.github.com/users/weavejester/events{/privacy}","received_events_url":"https://api.github.com/users/weavejester/received_events","type":"User","site_admin":false},"repo":{"id":358513,"name":"hiccup","full_name":"weavejester/hiccup","owner":{"login":"weavejester","id":8780,"avatar_url":"https://avatars.githubusercontent.com/u/8780?v=3","gravatar_id":"","url":"https://api.github.com/users/weavejester","html_url":"https://github.com/weavejester","followers_url":"https://api.github.com/users/weavejester/followers","following_url":"https://api.github.com/users/weavejester/following{/other_user}","gists_url":"https://api.github.com/users/weavejester/gists{/gist_id}","starred_url":"https://api.github.com/users/weavejester/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weavejester/subscriptions","organizations_url":"https://api.github.com/users/weavejester/orgs","repos_url":"https://api.github.com/users/weavejester/repos","events_url":"https://api.github.com/users/weavejester/events{/privacy}","received_events_url":"https://api.github.com/users/weavejester/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/weavejester/hiccup","description":"Fast library for rendering HTML in Clojure","fork":false,"url":"https://api.github.com/repos/weavejester/hiccup","forks_url":"https://api.github.com/repos/weavejester/hiccup/forks","keys_url":"https://api.github.com/repos/weavejester/hiccup/keys{/key_id}","collaborators_url":"https://api.github.com/repos/weavejester/hiccup/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/weavejester/hiccup/teams","hooks_url":"https://api.github.com/repos/weavejester/hiccup/hooks","issue_events_url":"https://api.github.com/repos/weavejester/hiccup/issues/events{/number}","events_url":"https://api.github.com/repos/weavejester/hiccup/events","assignees_url":"https://api.github.com/repos/weavejester/hiccup/assignees{/user}","branches_url":"https://api.github.com/repos/weavejester/hiccup/branches{/branch}","tags_url":"https://api.github.com/repos/weavejester/hiccup/tags","blobs_url":"https://api.github.com/repos/weavejester/hiccup/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/weavejester/hiccup/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/weavejester/hiccup/git/refs{/sha}","trees_url":"https://api.github.com/repos/weavejester/hiccup/git/trees{/sha}","statuses_url":"https://api.github.com/repos/weavejester/hiccup/statuses/{sha}","languages_url":"https://api.github.com/repos/weavejester/hiccup/languages","stargazers_url":"https://api.github.com/repos/weavejester/hiccup/stargazers","contributors_url":"https://api.github.com/repos/weavejester/hiccup/contributors","subscribers_url":"https://api.github.com/repos/weavejester/hiccup/subscribers","subscription_url":"https://api.github.com/repos/weavejester/hiccup/subscription","commits_url":"https://api.github.com/repos/weavejester/hiccup/commits{/sha}","git_commits_url":"https://api.github.com/repos/weavejester/hiccup/git/commits{/sha}","comments_url":"https://api.github.com/repos/weavejester/hiccup/comments{/number}","issue_comment_url":"https://api.github.com/repos/weavejester/hiccup/issues/comments{/number}","contents_url":"https://api.github.com/repos/weavejester/hiccup/contents/{+path}","compare_url":"https://api.github.com/repos/weavejester/hiccup/compare/{base}...{head}","merges_url":"https://api.github.com/repos/weavejester/hiccup/merges","archive_url":"https://api.github.com/repos/weavejester/hiccup/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/weavejester/hiccup/downloads","issues_url":"https://api.github.com/repos/weavejester/hiccup/issues{/number}","pulls_url":"https://api.github.com/repos/weavejester/hiccup/pulls{/number}","milestones_url":"https://api.github.com/repos/weavejester/hiccup/milestones{/number}","notifications_url":"https://api.github.com/repos/weavejester/hiccup/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/weavejester/hiccup/labels{/name}","releases_url":"https://api.github.com/repos/weavejester/hiccup/releases{/id}","created_at":"2009-11-02T21:08:16Z","updated_at":"2015-12-12T10:27:28Z","pushed_at":"2015-12-12T23:01:54Z","git_url":"git://github.com/weavejester/hiccup.git","ssh_url":"git@github.com:weavejester/hiccup.git","clone_url":"https://github.com/weavejester/hiccup.git","svn_url":"https://github.com/weavejester/hiccup","homepage":"http://weavejester.github.com/hiccup","size":532,"stargazers_count":1261,"watchers_count":1261,"language":"Clojure","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":106,"mirror_url":null,"open_issues_count":14,"forks":106,"open_issues":14,"watchers":1261,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/weavejester/hiccup/pulls/122"},"html":{"href":"https://github.com/weavejester/hiccup/pull/122"},"issue":{"href":"https://api.github.com/repos/weavejester/hiccup/issues/122"},"comments":{"href":"https://api.github.com/repos/weavejester/hiccup/issues/122/comments"},"review_comments":{"href":"https://api.github.com/repos/weavejester/hiccup/pulls/122/comments"},"review_comment":{"href":"https://api.github.com/repos/weavejester/hiccup/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/weavejester/hiccup/pulls/122/commits"},"statuses":{"href":"https://api.github.com/repos/weavejester/hiccup/statuses/0964377c125fc90a6312a9e8daac41b89fc0eed0"}}}}