zachwick / TableCSVExport

jQuery plugin to convert HTML table to CSV
http://zachwick.com/?p=87
43 stars 30 forks source link

br's should be replaced in all ways #7

Open rubo77 opened 11 years ago

rubo77 commented 11 years ago

a br should be replaced with a space even if it has some more parameters like:

 <br clear="all" ... />

cause if not, then word like some<br>words are displayed correctly: "some words".

otherwise it would look like "somewords"

rubo77 commented 11 years ago

maybe It could also be replaced by the correct Newline that is allowed in CSV?

If you add some more different cases to your test.html with <br> and <br /> and some quotes at the end of a td-content:

<td>"test"</td>

and also somethinbg like:

<td>a larger than: > and lower than: < should be displayed corectly</td>
rubo77 commented 11 years ago

this would be in the function formatData:

// strip HTML
output = output.replace("<br>"," ");
output = output.replace("<br/>"," ");
output = output.replace("<br />"," ");
output = output.replace('<br clear="all">'," ");
...
pauloortins commented 11 years ago

Write a pull request and we add it in the project =D