{"action":"created","comment":{"url":"https://api.github.com/repos/ecomfe/esui/pulls/comments/42350525","id":42350525,"diff_hunk":"@@ -372,29 +412,64 @@ define(\n              * @override\r\n              */\r\n             parseValue: function (value) {\r\n-                return lib.trim(value.replace(/\\n{2,}/g, '\\n')).split('\\n');\r\n+                return this.reviseRawValue(value.split('\\n'));\r\n             },\r\n \r\n             /**\r\n-             * 获取内容数组形式（去重，去空行）\r\n+             * 根据配置修正rawValue\r\n+             *\r\n+             * @param {Array} value 数组值\r\n+             * @return {string[]}\r\n+             */\r\n+            reviseRawValue: function (value) {\r\n+                // 如果要去空行\r\n+                if (this.withoutBlankLine) {\r\n+                    // 去掉数组中空值\r\n+                    value = u.compact(value);\r\n+                }\r\n+\r\n+                // 如果要去前后空格\r\n+                if (this.trim) {\r\n+                    value = u.map(value, lib.trim);\r\n+                }\r\n+\r\n+                // 如果要去重\r\n+                if (this.unique) {\r\n+                    value = u.unique(value);\r\n+                }\r\n+                return value;\r\n+            },\r\n+\r\n+            /**\r\n+             * 获取内容数组形式（根据配置选择去重，去空行以及去单行前后空格）\r\n              *\r\n              * @return {string[]}\r\n              * @override\r\n              */\r\n             getRawValue: function () {\r\n-                return u.unique(this.getValueRepeatableItems());\r\n+                return this.parseValue(this.getRawValueOfTextarea());\r\n+            },\r\n+\r\n+\r\n+            /**\r\n+             * 从textarea中获取原始值\r\n+             *\r\n+             * @public\r\n+             * @return {string}\r\n+             */\r\n+            getRawValueOfTextarea: function () {\r\n+                return this.helper.getPart('text').value;\r\n             },\r\n \r\n             /**\r\n              * 获取内容数组形式,并去除空串内容（不去重）\r\n+             * 理论上有了配置，这个接口没用了，但为了保证向前兼容，暂时放在这里\r\n              *\r\n              * @return {string[]}\r\n              */\r\n             getValueRepeatableItems: function () {\r\n-                var text = this.helper.getPart('text').value;\r\n-                var items = text.split('\\n');\r\n-\r\n-                return u.chain(items).map(lib.trim).compact().value();\r\n+                var value = this.getRawValueOfTextarea().split('\\n');\r\n+                return u.chain(value).map(lib.trim).compact().value();\r","path":"src/TextLine.js","position":257,"original_position":257,"commit_id":"93f4bb31c72740b8bae1fc91417b66d32db70779","original_commit_id":"93f4bb31c72740b8bae1fc91417b66d32db70779","user":{"login":"DDDBear","id":1559953,"avatar_url":"https://avatars.githubusercontent.com/u/1559953?v=3","gravatar_id":"","url":"https://api.github.com/users/DDDBear","html_url":"https://github.com/DDDBear","followers_url":"https://api.github.com/users/DDDBear/followers","following_url":"https://api.github.com/users/DDDBear/following{/other_user}","gists_url":"https://api.github.com/users/DDDBear/gists{/gist_id}","starred_url":"https://api.github.com/users/DDDBear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DDDBear/subscriptions","organizations_url":"https://api.github.com/users/DDDBear/orgs","repos_url":"https://api.github.com/users/DDDBear/repos","events_url":"https://api.github.com/users/DDDBear/events{/privacy}","received_events_url":"https://api.github.com/users/DDDBear/received_events","type":"User","site_admin":false},"body":"这个不受，为的是向前兼容，其实跟以前的是一致的。","created_at":"2015-10-19T09:18:00Z","updated_at":"2015-10-19T09:18:00Z","html_url":"https://github.com/ecomfe/esui/pull/522#discussion_r42350525","pull_request_url":"https://api.github.com/repos/ecomfe/esui/pulls/522","_links":{"self":{"href":"https://api.github.com/repos/ecomfe/esui/pulls/comments/42350525"},"html":{"href":"https://github.com/ecomfe/esui/pull/522#discussion_r42350525"},"pull_request":{"href":"https://api.github.com/repos/ecomfe/esui/pulls/522"}}},"pull_request":{"url":"https://api.github.com/repos/ecomfe/esui/pulls/522","id":47626636,"html_url":"https://github.com/ecomfe/esui/pull/522","diff_url":"https://github.com/ecomfe/esui/pull/522.diff","patch_url":"https://github.com/ecomfe/esui/pull/522.patch","issue_url":"https://api.github.com/repos/ecomfe/esui/issues/522","number":522,"state":"open","locked":false,"title":"Upgrade textline for 3.1","user":{"login":"DDDBear","id":1559953,"avatar_url":"https://avatars.githubusercontent.com/u/1559953?v=3","gravatar_id":"","url":"https://api.github.com/users/DDDBear","html_url":"https://github.com/DDDBear","followers_url":"https://api.github.com/users/DDDBear/followers","following_url":"https://api.github.com/users/DDDBear/following{/other_user}","gists_url":"https://api.github.com/users/DDDBear/gists{/gist_id}","starred_url":"https://api.github.com/users/DDDBear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DDDBear/subscriptions","organizations_url":"https://api.github.com/users/DDDBear/orgs","repos_url":"https://api.github.com/users/DDDBear/repos","events_url":"https://api.github.com/users/DDDBear/events{/privacy}","received_events_url":"https://api.github.com/users/DDDBear/received_events","type":"User","site_admin":false},"body":"升级textline\r\n增加三个新属性：unique， trim，withoutBlankLine，允许对“去重”，“去前后空格”，“去空行”做自定义配置。\r\n\r\n修改一个bug：input输入时同步修改rawValue。","created_at":"2015-10-14T07:39:52Z","updated_at":"2015-10-19T09:18:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f1c8a73316ea33141eeff74271d9ec7fc49537d7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ecomfe/esui/pulls/522/commits","review_comments_url":"https://api.github.com/repos/ecomfe/esui/pulls/522/comments","review_comment_url":"https://api.github.com/repos/ecomfe/esui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ecomfe/esui/issues/522/comments","statuses_url":"https://api.github.com/repos/ecomfe/esui/statuses/93f4bb31c72740b8bae1fc91417b66d32db70779","head":{"label":"DDDBear:upgrade-textline-for-3.1","ref":"upgrade-textline-for-3.1","sha":"93f4bb31c72740b8bae1fc91417b66d32db70779","user":{"login":"DDDBear","id":1559953,"avatar_url":"https://avatars.githubusercontent.com/u/1559953?v=3","gravatar_id":"","url":"https://api.github.com/users/DDDBear","html_url":"https://github.com/DDDBear","followers_url":"https://api.github.com/users/DDDBear/followers","following_url":"https://api.github.com/users/DDDBear/following{/other_user}","gists_url":"https://api.github.com/users/DDDBear/gists{/gist_id}","starred_url":"https://api.github.com/users/DDDBear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DDDBear/subscriptions","organizations_url":"https://api.github.com/users/DDDBear/orgs","repos_url":"https://api.github.com/users/DDDBear/repos","events_url":"https://api.github.com/users/DDDBear/events{/privacy}","received_events_url":"https://api.github.com/users/DDDBear/received_events","type":"User","site_admin":false},"repo":{"id":44158127,"name":"esui","full_name":"DDDBear/esui","owner":{"login":"DDDBear","id":1559953,"avatar_url":"https://avatars.githubusercontent.com/u/1559953?v=3","gravatar_id":"","url":"https://api.github.com/users/DDDBear","html_url":"https://github.com/DDDBear","followers_url":"https://api.github.com/users/DDDBear/followers","following_url":"https://api.github.com/users/DDDBear/following{/other_user}","gists_url":"https://api.github.com/users/DDDBear/gists{/gist_id}","starred_url":"https://api.github.com/users/DDDBear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DDDBear/subscriptions","organizations_url":"https://api.github.com/users/DDDBear/orgs","repos_url":"https://api.github.com/users/DDDBear/repos","events_url":"https://api.github.com/users/DDDBear/events{/privacy}","received_events_url":"https://api.github.com/users/DDDBear/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/DDDBear/esui","description":"enterprise simple ui library","fork":true,"url":"https://api.github.com/repos/DDDBear/esui","forks_url":"https://api.github.com/repos/DDDBear/esui/forks","keys_url":"https://api.github.com/repos/DDDBear/esui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DDDBear/esui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DDDBear/esui/teams","hooks_url":"https://api.github.com/repos/DDDBear/esui/hooks","issue_events_url":"https://api.github.com/repos/DDDBear/esui/issues/events{/number}","events_url":"https://api.github.com/repos/DDDBear/esui/events","assignees_url":"https://api.github.com/repos/DDDBear/esui/assignees{/user}","branches_url":"https://api.github.com/repos/DDDBear/esui/branches{/branch}","tags_url":"https://api.github.com/repos/DDDBear/esui/tags","blobs_url":"https://api.github.com/repos/DDDBear/esui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DDDBear/esui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DDDBear/esui/git/refs{/sha}","trees_url":"https://api.github.com/repos/DDDBear/esui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DDDBear/esui/statuses/{sha}","languages_url":"https://api.github.com/repos/DDDBear/esui/languages","stargazers_url":"https://api.github.com/repos/DDDBear/esui/stargazers","contributors_url":"https://api.github.com/repos/DDDBear/esui/contributors","subscribers_url":"https://api.github.com/repos/DDDBear/esui/subscribers","subscription_url":"https://api.github.com/repos/DDDBear/esui/subscription","commits_url":"https://api.github.com/repos/DDDBear/esui/commits{/sha}","git_commits_url":"https://api.github.com/repos/DDDBear/esui/git/commits{/sha}","comments_url":"https://api.github.com/repos/DDDBear/esui/comments{/number}","issue_comment_url":"https://api.github.com/repos/DDDBear/esui/issues/comments{/number}","contents_url":"https://api.github.com/repos/DDDBear/esui/contents/{+path}","compare_url":"https://api.github.com/repos/DDDBear/esui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DDDBear/esui/merges","archive_url":"https://api.github.com/repos/DDDBear/esui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DDDBear/esui/downloads","issues_url":"https://api.github.com/repos/DDDBear/esui/issues{/number}","pulls_url":"https://api.github.com/repos/DDDBear/esui/pulls{/number}","milestones_url":"https://api.github.com/repos/DDDBear/esui/milestones{/number}","notifications_url":"https://api.github.com/repos/DDDBear/esui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DDDBear/esui/labels{/name}","releases_url":"https://api.github.com/repos/DDDBear/esui/releases{/id}","created_at":"2015-10-13T07:00:32Z","updated_at":"2015-10-13T07:00:34Z","pushed_at":"2015-10-14T08:02:42Z","git_url":"git://github.com/DDDBear/esui.git","ssh_url":"git@github.com:DDDBear/esui.git","clone_url":"https://github.com/DDDBear/esui.git","svn_url":"https://github.com/DDDBear/esui","homepage":null,"size":6290,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"ecomfe:3.1.0-dev","ref":"3.1.0-dev","sha":"f8b41aa02ea35c402f36c73af6555ae88dce8564","user":{"login":"ecomfe","id":2268460,"avatar_url":"https://avatars.githubusercontent.com/u/2268460?v=3","gravatar_id":"","url":"https://api.github.com/users/ecomfe","html_url":"https://github.com/ecomfe","followers_url":"https://api.github.com/users/ecomfe/followers","following_url":"https://api.github.com/users/ecomfe/following{/other_user}","gists_url":"https://api.github.com/users/ecomfe/gists{/gist_id}","starred_url":"https://api.github.com/users/ecomfe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecomfe/subscriptions","organizations_url":"https://api.github.com/users/ecomfe/orgs","repos_url":"https://api.github.com/users/ecomfe/repos","events_url":"https://api.github.com/users/ecomfe/events{/privacy}","received_events_url":"https://api.github.com/users/ecomfe/received_events","type":"Organization","site_admin":false},"repo":{"id":7668304,"name":"esui","full_name":"ecomfe/esui","owner":{"login":"ecomfe","id":2268460,"avatar_url":"https://avatars.githubusercontent.com/u/2268460?v=3","gravatar_id":"","url":"https://api.github.com/users/ecomfe","html_url":"https://github.com/ecomfe","followers_url":"https://api.github.com/users/ecomfe/followers","following_url":"https://api.github.com/users/ecomfe/following{/other_user}","gists_url":"https://api.github.com/users/ecomfe/gists{/gist_id}","starred_url":"https://api.github.com/users/ecomfe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ecomfe/subscriptions","organizations_url":"https://api.github.com/users/ecomfe/orgs","repos_url":"https://api.github.com/users/ecomfe/repos","events_url":"https://api.github.com/users/ecomfe/events{/privacy}","received_events_url":"https://api.github.com/users/ecomfe/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ecomfe/esui","description":"enterprise simple ui library","fork":false,"url":"https://api.github.com/repos/ecomfe/esui","forks_url":"https://api.github.com/repos/ecomfe/esui/forks","keys_url":"https://api.github.com/repos/ecomfe/esui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ecomfe/esui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ecomfe/esui/teams","hooks_url":"https://api.github.com/repos/ecomfe/esui/hooks","issue_events_url":"https://api.github.com/repos/ecomfe/esui/issues/events{/number}","events_url":"https://api.github.com/repos/ecomfe/esui/events","assignees_url":"https://api.github.com/repos/ecomfe/esui/assignees{/user}","branches_url":"https://api.github.com/repos/ecomfe/esui/branches{/branch}","tags_url":"https://api.github.com/repos/ecomfe/esui/tags","blobs_url":"https://api.github.com/repos/ecomfe/esui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ecomfe/esui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ecomfe/esui/git/refs{/sha}","trees_url":"https://api.github.com/repos/ecomfe/esui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ecomfe/esui/statuses/{sha}","languages_url":"https://api.github.com/repos/ecomfe/esui/languages","stargazers_url":"https://api.github.com/repos/ecomfe/esui/stargazers","contributors_url":"https://api.github.com/repos/ecomfe/esui/contributors","subscribers_url":"https://api.github.com/repos/ecomfe/esui/subscribers","subscription_url":"https://api.github.com/repos/ecomfe/esui/subscription","commits_url":"https://api.github.com/repos/ecomfe/esui/commits{/sha}","git_commits_url":"https://api.github.com/repos/ecomfe/esui/git/commits{/sha}","comments_url":"https://api.github.com/repos/ecomfe/esui/comments{/number}","issue_comment_url":"https://api.github.com/repos/ecomfe/esui/issues/comments{/number}","contents_url":"https://api.github.com/repos/ecomfe/esui/contents/{+path}","compare_url":"https://api.github.com/repos/ecomfe/esui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ecomfe/esui/merges","archive_url":"https://api.github.com/repos/ecomfe/esui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ecomfe/esui/downloads","issues_url":"https://api.github.com/repos/ecomfe/esui/issues{/number}","pulls_url":"https://api.github.com/repos/ecomfe/esui/pulls{/number}","milestones_url":"https://api.github.com/repos/ecomfe/esui/milestones{/number}","notifications_url":"https://api.github.com/repos/ecomfe/esui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ecomfe/esui/labels{/name}","releases_url":"https://api.github.com/repos/ecomfe/esui/releases{/id}","created_at":"2013-01-17T15:10:21Z","updated_at":"2015-10-13T09:13:21Z","pushed_at":"2015-10-14T08:05:27Z","git_url":"git://github.com/ecomfe/esui.git","ssh_url":"git@github.com:ecomfe/esui.git","clone_url":"https://github.com/ecomfe/esui.git","svn_url":"https://github.com/ecomfe/esui","homepage":null,"size":10732,"stargazers_count":171,"watchers_count":171,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":149,"mirror_url":null,"open_issues_count":69,"forks":149,"open_issues":69,"watchers":171,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ecomfe/esui/pulls/522"},"html":{"href":"https://github.com/ecomfe/esui/pull/522"},"issue":{"href":"https://api.github.com/repos/ecomfe/esui/issues/522"},"comments":{"href":"https://api.github.com/repos/ecomfe/esui/issues/522/comments"},"review_comments":{"href":"https://api.github.com/repos/ecomfe/esui/pulls/522/comments"},"review_comment":{"href":"https://api.github.com/repos/ecomfe/esui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ecomfe/esui/pulls/522/commits"},"statuses":{"href":"https://api.github.com/repos/ecomfe/esui/statuses/93f4bb31c72740b8bae1fc91417b66d32db70779"}}}}