HTML character transfer

abes posted 5 years ago in Import/Export
Using "Export grid rows->HTML table" of a view generated using the following code
CONCAT('<a href="', part.link, '"<', 'link', '></a>') AS 'Weblink'
generates a table line

<td class="col8"><a href="http://www.alliedelec.com/search/searchresults.aspx?dsNav=Ntk:Primary|203STBW|3|,Ny:True,Ro:0&dsDimensionSearch=D:203STBW,Dxm:All,Dxp:3&SearchType=0"<link></a></td>

where the <, > characters appearing in as <, > so the link does not work.

Please let me know your suggestions.
abes posted 5 years ago
Unfortunately the browser rendered the characters right in the forum.

Again here are the converted <, > characters as the Notepad++ shows them & lt and & gt.
ansgar posted 5 years ago
Yes, such special characters are encoded by HeidiSQL, using their HTML entity representations. Normally you have non-HTML content in the cells, and when these contain < or >, that would break the exported table. The fact that you now have a situation in which you explicitly *want* these characters means you need a checkbox option. Something like "Encode special HTML characters", which you uncheck. Only I'm afraid another checkbox would start to overcrowd that simple dialog, doesn't it?
kalvaro posted 5 years ago
HeidiSQL is doing it just fine:
is the correct HTML representation of
. It's not reasonable to expect that HeidiSQL or any other piece of software visually inspects your result set and decide that some arbitrary columns must be handled as raw HTML just because they have angle brackets.

BTW, running e.g. this:

SELECT CONCAT('<a href="', 'http://example.com', '"<', 'link', '></a>') AS 'Weblink'

... generates this:

<a href="http://example.com"<link></a>

... which is malformed HTML.
ansgar posted 5 years ago
Hehe, posted just 16 seconds one after the other :)
kalvaro posted 5 years ago
P.S. Anse, since the forum software does not accept HTML tags at all, it should not treat strings that start with ampersand as HTML entities.
ansgar posted 5 years ago
Yes... that means entities need to be double encoded. Which again means currently entities are not double encoded, and that's a bit strange. Will check that.
TechMan10 posted 3 months ago

Hello, I realize that this is an old thread. So, if I understand correctly, this cannot be done? Or can this be achieved by some clever escaping technique?

I too am trying to export a concatenated link.


Please login to leave a reply, or register at first.