Unexpected output exporting to CSV with HTML characters in the TD

Unexpected output exporting to CSV with HTML characters in the TD

blueghostukblueghostuk Posts: 6Questions: 2Answers: 0

See the linked example: https://jsfiddle.net/blueghostuk/c4b0akzu/

when exporting to CSV the row is exported as

"Some More Text"">Some Text > Some More Text"

when it should be

"Some Text > Some More Text"

the html tag stripping is failing as the span title has the > character in it.

This can be worked around be encoding the title tag to use > but then the title tooltip shows > and not >

Answers

  • blueghostukblueghostuk Posts: 6Questions: 2Answers: 0

    meant to read as you can change the title tag to use > but it renders as such and not > as desired

  • allanallan Posts: 63,455Questions: 1Answers: 10,465 Site admin

    Hi,

    This is a limitation in the way DataTables handles the column titles at the moment I'm afraid. It doesn't do a great job when there is HTML inside an element's attributes.

    This is something that needs to be addressed and is currently on the list.

    Allan

  • blueghostukblueghostuk Posts: 6Questions: 2Answers: 0

    Ok thanks, we have removed the title attribute anyway for now which works around this, but thanks for getting back to me

This discussion has been closed.