{"action":"created","comment":{"url":"https://api.github.com/repos/dimagi/Vellum/pulls/comments/49550494","id":49550494,"diff_hunk":"@@ -897,14 +907,27 @@ define([\n                 mug.options.afterInsert(this, mug);\n             }\n         },\n-        _updateMugPath: function (mug, oldPath, newPath) {\n-            var map = this.mugMap;\n-            delete map[oldPath];\n-            if (_.isUndefined(newPath)) {\n+        _updateMugPath: function (mug, oldHashtag, newHashtag) {\n+            var map = this.mugMap, newPath;\n+            delete map[normalizeHashtag(oldHashtag)];\n+            if (oldHashtag) {\n+                xpath.removeHashtag(oldHashtag);","path":"src/form.js","position":119,"original_position":119,"commit_id":"e53b08e77897685d799882672e70e67f02d91083","original_commit_id":"e53b08e77897685d799882672e70e67f02d91083","user":{"login":"millerdev","id":464726,"avatar_url":"https://avatars.githubusercontent.com/u/464726?v=3","gravatar_id":"","url":"https://api.github.com/users/millerdev","html_url":"https://github.com/millerdev","followers_url":"https://api.github.com/users/millerdev/followers","following_url":"https://api.github.com/users/millerdev/following{/other_user}","gists_url":"https://api.github.com/users/millerdev/gists{/gist_id}","starred_url":"https://api.github.com/users/millerdev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/millerdev/subscriptions","organizations_url":"https://api.github.com/users/millerdev/orgs","repos_url":"https://api.github.com/users/millerdev/repos","events_url":"https://api.github.com/users/millerdev/events{/privacy}","received_events_url":"https://api.github.com/users/millerdev/received_events","type":"User","site_admin":false},"body":"To create a new xpath parser, the form constructor should do something like\r\n```js\r\nthis.hashtagToXPath = {};\r\nthis.xpath = xpath.createParser(this.hashtagToXPath);\r\n```\r\n`xpath.createParser` should create the object that is currently exported by the `vellum/xpath` module.","created_at":"2016-01-13T04:24:55Z","updated_at":"2016-01-13T04:24:55Z","html_url":"https://github.com/dimagi/Vellum/pull/595#discussion_r49550494","pull_request_url":"https://api.github.com/repos/dimagi/Vellum/pulls/595","_links":{"self":{"href":"https://api.github.com/repos/dimagi/Vellum/pulls/comments/49550494"},"html":{"href":"https://github.com/dimagi/Vellum/pull/595#discussion_r49550494"},"pull_request":{"href":"https://api.github.com/repos/dimagi/Vellum/pulls/595"}}},"pull_request":{"url":"https://api.github.com/repos/dimagi/Vellum/pulls/595","id":55775140,"html_url":"https://github.com/dimagi/Vellum/pull/595","diff_url":"https://github.com/dimagi/Vellum/pull/595.diff","patch_url":"https://github.com/dimagi/Vellum/pull/595.patch","issue_url":"https://api.github.com/repos/dimagi/Vellum/issues/595","number":595,"state":"open","locked":false,"title":"#form","user":{"login":"emord","id":1471773,"avatar_url":"https://avatars.githubusercontent.com/u/1471773?v=3","gravatar_id":"","url":"https://api.github.com/users/emord","html_url":"https://github.com/emord","followers_url":"https://api.github.com/users/emord/followers","following_url":"https://api.github.com/users/emord/following{/other_user}","gists_url":"https://api.github.com/users/emord/gists{/gist_id}","starred_url":"https://api.github.com/users/emord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emord/subscriptions","organizations_url":"https://api.github.com/users/emord/orgs","repos_url":"https://api.github.com/users/emord/repos","events_url":"https://api.github.com/users/emord/events{/privacy}","received_events_url":"https://api.github.com/users/emord/received_events","type":"User","site_admin":false},"body":"@millerdev \r\n\r\nCommtrack and key value widgets (save to case and intent manager response in form builder) don't support rich text/hashtag syntax at the moment. Commtrack because it uses filters. key value widgets because we'd need to create a lot of ckeditor widgets (and the widget refactor would probably be a little messy for an advanced feature)\r\n\r\nIgnore but retain also ignores #form syntax because those are manually written anyway.\r\n\r\nWhen turning off bubbles it should reference /data/ instead of #form:\r\n\r\n![image](https://cloud.githubusercontent.com/assets/1471773/12268168/a126bb0e-b919-11e5-813b-cfe6857b0fe6.png)\r\n\r\n![image](https://cloud.githubusercontent.com/assets/1471773/12268136/7c09c8ca-b919-11e5-995e-93dbdc6d9823.png)\r\n\r\nIt's a big PR but a lot is XML/test changes to look at #form instead of /data The first commit should contain all xml changes and shows what xml will look like after this.\r\n\r\ncc: @sravfeyn ","created_at":"2016-01-12T15:46:14Z","updated_at":"2016-01-13T04:24:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bcfcf301c0736975373112edb052c65f63cd6c07","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dimagi/Vellum/pulls/595/commits","review_comments_url":"https://api.github.com/repos/dimagi/Vellum/pulls/595/comments","review_comment_url":"https://api.github.com/repos/dimagi/Vellum/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dimagi/Vellum/issues/595/comments","statuses_url":"https://api.github.com/repos/dimagi/Vellum/statuses/e53b08e77897685d799882672e70e67f02d91083","head":{"label":"dimagi:hashtag-form-final","ref":"hashtag-form-final","sha":"e53b08e77897685d799882672e70e67f02d91083","user":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":1859793,"name":"Vellum","full_name":"dimagi/Vellum","owner":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/Vellum","description":"An XForms form designer written purely in Javascript","fork":false,"url":"https://api.github.com/repos/dimagi/Vellum","forks_url":"https://api.github.com/repos/dimagi/Vellum/forks","keys_url":"https://api.github.com/repos/dimagi/Vellum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/Vellum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/Vellum/teams","hooks_url":"https://api.github.com/repos/dimagi/Vellum/hooks","issue_events_url":"https://api.github.com/repos/dimagi/Vellum/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/Vellum/events","assignees_url":"https://api.github.com/repos/dimagi/Vellum/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/Vellum/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/Vellum/tags","blobs_url":"https://api.github.com/repos/dimagi/Vellum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/Vellum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/Vellum/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/Vellum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/Vellum/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/Vellum/languages","stargazers_url":"https://api.github.com/repos/dimagi/Vellum/stargazers","contributors_url":"https://api.github.com/repos/dimagi/Vellum/contributors","subscribers_url":"https://api.github.com/repos/dimagi/Vellum/subscribers","subscription_url":"https://api.github.com/repos/dimagi/Vellum/subscription","commits_url":"https://api.github.com/repos/dimagi/Vellum/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/Vellum/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/Vellum/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/Vellum/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/Vellum/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/Vellum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/Vellum/merges","archive_url":"https://api.github.com/repos/dimagi/Vellum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/Vellum/downloads","issues_url":"https://api.github.com/repos/dimagi/Vellum/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/Vellum/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/Vellum/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/Vellum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/Vellum/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/Vellum/releases{/id}","created_at":"2011-06-07T13:03:34Z","updated_at":"2015-12-23T15:59:15Z","pushed_at":"2016-01-12T23:03:26Z","git_url":"git://github.com/dimagi/Vellum.git","ssh_url":"git@github.com:dimagi/Vellum.git","clone_url":"https://github.com/dimagi/Vellum.git","svn_url":"https://github.com/dimagi/Vellum","homepage":"","size":13183,"stargazers_count":37,"watchers_count":37,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":3,"forks":17,"open_issues":3,"watchers":37,"default_branch":"master"}},"base":{"label":"dimagi:master","ref":"master","sha":"7115808021251d3e7e8f09cbd945e48011c579e2","user":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"repo":{"id":1859793,"name":"Vellum","full_name":"dimagi/Vellum","owner":{"login":"dimagi","id":94514,"avatar_url":"https://avatars.githubusercontent.com/u/94514?v=3","gravatar_id":"","url":"https://api.github.com/users/dimagi","html_url":"https://github.com/dimagi","followers_url":"https://api.github.com/users/dimagi/followers","following_url":"https://api.github.com/users/dimagi/following{/other_user}","gists_url":"https://api.github.com/users/dimagi/gists{/gist_id}","starred_url":"https://api.github.com/users/dimagi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimagi/subscriptions","organizations_url":"https://api.github.com/users/dimagi/orgs","repos_url":"https://api.github.com/users/dimagi/repos","events_url":"https://api.github.com/users/dimagi/events{/privacy}","received_events_url":"https://api.github.com/users/dimagi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dimagi/Vellum","description":"An XForms form designer written purely in Javascript","fork":false,"url":"https://api.github.com/repos/dimagi/Vellum","forks_url":"https://api.github.com/repos/dimagi/Vellum/forks","keys_url":"https://api.github.com/repos/dimagi/Vellum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dimagi/Vellum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dimagi/Vellum/teams","hooks_url":"https://api.github.com/repos/dimagi/Vellum/hooks","issue_events_url":"https://api.github.com/repos/dimagi/Vellum/issues/events{/number}","events_url":"https://api.github.com/repos/dimagi/Vellum/events","assignees_url":"https://api.github.com/repos/dimagi/Vellum/assignees{/user}","branches_url":"https://api.github.com/repos/dimagi/Vellum/branches{/branch}","tags_url":"https://api.github.com/repos/dimagi/Vellum/tags","blobs_url":"https://api.github.com/repos/dimagi/Vellum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dimagi/Vellum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dimagi/Vellum/git/refs{/sha}","trees_url":"https://api.github.com/repos/dimagi/Vellum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dimagi/Vellum/statuses/{sha}","languages_url":"https://api.github.com/repos/dimagi/Vellum/languages","stargazers_url":"https://api.github.com/repos/dimagi/Vellum/stargazers","contributors_url":"https://api.github.com/repos/dimagi/Vellum/contributors","subscribers_url":"https://api.github.com/repos/dimagi/Vellum/subscribers","subscription_url":"https://api.github.com/repos/dimagi/Vellum/subscription","commits_url":"https://api.github.com/repos/dimagi/Vellum/commits{/sha}","git_commits_url":"https://api.github.com/repos/dimagi/Vellum/git/commits{/sha}","comments_url":"https://api.github.com/repos/dimagi/Vellum/comments{/number}","issue_comment_url":"https://api.github.com/repos/dimagi/Vellum/issues/comments{/number}","contents_url":"https://api.github.com/repos/dimagi/Vellum/contents/{+path}","compare_url":"https://api.github.com/repos/dimagi/Vellum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dimagi/Vellum/merges","archive_url":"https://api.github.com/repos/dimagi/Vellum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dimagi/Vellum/downloads","issues_url":"https://api.github.com/repos/dimagi/Vellum/issues{/number}","pulls_url":"https://api.github.com/repos/dimagi/Vellum/pulls{/number}","milestones_url":"https://api.github.com/repos/dimagi/Vellum/milestones{/number}","notifications_url":"https://api.github.com/repos/dimagi/Vellum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dimagi/Vellum/labels{/name}","releases_url":"https://api.github.com/repos/dimagi/Vellum/releases{/id}","created_at":"2011-06-07T13:03:34Z","updated_at":"2015-12-23T15:59:15Z","pushed_at":"2016-01-12T23:03:26Z","git_url":"git://github.com/dimagi/Vellum.git","ssh_url":"git@github.com:dimagi/Vellum.git","clone_url":"https://github.com/dimagi/Vellum.git","svn_url":"https://github.com/dimagi/Vellum","homepage":"","size":13183,"stargazers_count":37,"watchers_count":37,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":3,"forks":17,"open_issues":3,"watchers":37,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dimagi/Vellum/pulls/595"},"html":{"href":"https://github.com/dimagi/Vellum/pull/595"},"issue":{"href":"https://api.github.com/repos/dimagi/Vellum/issues/595"},"comments":{"href":"https://api.github.com/repos/dimagi/Vellum/issues/595/comments"},"review_comments":{"href":"https://api.github.com/repos/dimagi/Vellum/pulls/595/comments"},"review_comment":{"href":"https://api.github.com/repos/dimagi/Vellum/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dimagi/Vellum/pulls/595/commits"},"statuses":{"href":"https://api.github.com/repos/dimagi/Vellum/statuses/e53b08e77897685d799882672e70e67f02d91083"}}}}