{"action":"created","issue":{"url":"https://api.github.com/repos/clarketm/TableExport/issues/70","repository_url":"https://api.github.com/repos/clarketm/TableExport","labels_url":"https://api.github.com/repos/clarketm/TableExport/issues/70/labels{/name}","comments_url":"https://api.github.com/repos/clarketm/TableExport/issues/70/comments","events_url":"https://api.github.com/repos/clarketm/TableExport/issues/70/events","html_url":"https://github.com/clarketm/TableExport/issues/70","id":235330500,"number":70,"title":"Trailing new line is causing a new row in excel to be created.","user":{"login":"CrestApps","id":24724371,"avatar_url":"https://avatars2.githubusercontent.com/u/24724371?v=3","gravatar_id":"","url":"https://api.github.com/users/CrestApps","html_url":"https://github.com/CrestApps","followers_url":"https://api.github.com/users/CrestApps/followers","following_url":"https://api.github.com/users/CrestApps/following{/other_user}","gists_url":"https://api.github.com/users/CrestApps/gists{/gist_id}","starred_url":"https://api.github.com/users/CrestApps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CrestApps/subscriptions","organizations_url":"https://api.github.com/users/CrestApps/orgs","repos_url":"https://api.github.com/users/CrestApps/repos","events_url":"https://api.github.com/users/CrestApps/events{/privacy}","received_events_url":"https://api.github.com/users/CrestApps/received_events","type":"User","site_admin":false},"labels":[{"id":485632191,"url":"https://api.github.com/repos/clarketm/TableExport/labels/fixed","name":"fixed","color":"fbca04","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-06-12T18:51:52Z","updated_at":"2017-06-13T22:14:34Z","closed_at":"2017-06-13T17:22:46Z","body":"I have a report that I generate using a basic HTML table. However, when my cell ends with `\\r\\n` for some reason the plugin does not remove that ending special new line causing the exported file to show a new line.\r\n\r\nHere is an example of my data\r\n\r\n`<tr><td>This is a test \\r\\n</td></tr>`\r\n\r\nThe above line causes the excel file to show a new row.\r\n\r\nFrom the doc, the option `trimWhitespace` should be set to true to fix this problem. \r\n\r\nI think there are two issues here;  first in the docs and another in the functionality. \r\n\r\nThe docs say that the default value for `trimWhitespace`  is false but from reading the code it seems to be set to `true`. This line show that it is set to true by default. https://github.com/clarketm/TableExport/blob/master/dist/js/tableexport.js#L167\r\n\r\nThe second issue is with the function, setting `trimWhitespace`  to true is not trimming `\\r\\n`. When briefly looking over the code, I see that you are calling the `String.trim()` method, https://github.com/clarketm/TableExport/blob/master/dist/js/tableexport.js#L442-L449 which for some reason is failing. The only thing that I can think about here is that you are passing `<tr><td>This is a test \\r\\n</td></tr>` or `<td>This is a test \\r\\n</td>` to the formatValue function which is why it is not trimming it correctly.\r\n\r\nThank you\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/clarketm/TableExport/issues/comments/308264419","html_url":"https://github.com/clarketm/TableExport/issues/70#issuecomment-308264419","issue_url":"https://api.github.com/repos/clarketm/TableExport/issues/70","id":308264419,"user":{"login":"CrestApps","id":24724371,"avatar_url":"https://avatars2.githubusercontent.com/u/24724371?v=3","gravatar_id":"","url":"https://api.github.com/users/CrestApps","html_url":"https://github.com/CrestApps","followers_url":"https://api.github.com/users/CrestApps/followers","following_url":"https://api.github.com/users/CrestApps/following{/other_user}","gists_url":"https://api.github.com/users/CrestApps/gists{/gist_id}","starred_url":"https://api.github.com/users/CrestApps/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CrestApps/subscriptions","organizations_url":"https://api.github.com/users/CrestApps/orgs","repos_url":"https://api.github.com/users/CrestApps/repos","events_url":"https://api.github.com/users/CrestApps/events{/privacy}","received_events_url":"https://api.github.com/users/CrestApps/received_events","type":"User","site_admin":false},"created_at":"2017-06-13T22:14:34Z","updated_at":"2017-06-13T22:14:34Z","body":"Thanks for fixing that so quick.\r\n\r\nWhen using V4.0.11, after clicking on export, I get the following error in the console and nothing is exported `TypeError: r is not a function[Learn More]`"}}
{"actor":{"display_login":"CrestApps"}}