{"action":"opened","issue":{"url":"https://api.github.com/repos/Day8/re-com/issues/35","labels_url":"https://api.github.com/repos/Day8/re-com/issues/35/labels{/name}","comments_url":"https://api.github.com/repos/Day8/re-com/issues/35/comments","events_url":"https://api.github.com/repos/Day8/re-com/issues/35/events","html_url":"https://github.com/Day8/re-com/issues/35","id":91590413,"number":35,"title":"merge bug with [p] component ","user":{"login":"mike-thompson-day8","id":3033376,"avatar_url":"https://avatars.githubusercontent.com/u/3033376?v=3","gravatar_id":"","url":"https://api.github.com/users/mike-thompson-day8","html_url":"https://github.com/mike-thompson-day8","followers_url":"https://api.github.com/users/mike-thompson-day8/followers","following_url":"https://api.github.com/users/mike-thompson-day8/following{/other_user}","gists_url":"https://api.github.com/users/mike-thompson-day8/gists{/gist_id}","starred_url":"https://api.github.com/users/mike-thompson-day8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mike-thompson-day8/subscriptions","organizations_url":"https://api.github.com/users/mike-thompson-day8/orgs","repos_url":"https://api.github.com/users/mike-thompson-day8/repos","events_url":"https://api.github.com/users/mike-thompson-day8/events{/privacy}","received_events_url":"https://api.github.com/users/mike-thompson-day8/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-28T11:46:05Z","updated_at":"2015-06-28T11:46:05Z","closed_at":null,"body":"The [p] component has a bug:\r\nhttps://github.com/Day8/re-com/blob/ecc55f3f2679548583efae56024f5eab634f1447/src/re_com/text.cljs#L76-L91\r\n\r\nThe code incorrectly assumes that `merge` works deeply on given maps (`:style` sub-maps to be exact). \r\n\r\nIn effect, the code incorrectly assumes that `(merge   {:style {:a 1}}   {:style { :b 3}})`   would return `{:style {:a 1 :b 3}}`  but it actually returns `{:style {:b 3}}`.\r\n\r\nSo use of `merge` should be replaced with `deep-merge`  written as:\r\n```\r\n(defn deep-merge\r\n  \"Recursively merges maps. If vals are not maps, the last value wins.\"\r\n  [& vals]\r\n  (if (every? map? vals)\r\n    (apply merge-with deep-merge vals)\r\n    (last vals)))\r\n```\r\n"}}