Needs work
Project:
Token formatters
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Reporter:
Created:
8 Sep 2012 at 16:40 UTC
Updated:
9 Sep 2012 at 18:37 UTC
Jump to comment: Most recent file
#1716098: Support HTML in the token rewrite? reopen.
I tried using [user:field_address] token that returns me an address field from addressfield / addressfield_tokens modules and I see below code in the node. How can we loosen the rules or can you add <span> to the good tags? May use a filter format that allows more tags?
Example:
<span class="first-name">MyFirstname</span> <span class="last-name">MyLastname</span>MyStreet 63<span class="postal-code">12345</span> <span class="locality">MyCity</span><span class="country">Germany</span>
Need to investigate with latest code if duplicate of #1768510: Single quotes in [entity:label] are shown as "'".
Comments
Comment #1
hass commentedNot a duplicate of #1768510: Single quotes in [entity:label] are shown as "'". Still broken in latest GID clone.
Comment #2
hass commentedNormally the $text is:
<div class="addressfield-container-inline name-block"><span class="first-name">Firstname</span> <span class="last-name">Lastname</span></div><div class="street-block"><div class="thoroughfare">My street. 1</div></div><div class="addressfield-container-inline locality-block country-DE"><span class="postal-code">12345</span> <span class="locality">City</span></div><span class="country">Germany</span>All DIV's are removed and the SPANs are shown as html tags.
Comment #3
hass commentedI guess
#titleis always checkplained.'#html' => TRUEseems to have no effect.Comment #4
hass commentedComment #5
hass commentedPatch attached.
Comment #6
hass commentedBetter patch.
Comment #7
hass commentedCross patched. New reduced patch
Comment #8
dave reidNote that using
<div>tags are not actually valid to use in<a>tags:http://stackoverflow.com/questions/1827965/is-putting-a-div-inside-an-an...
http://stackoverflow.com/questions/1091739/html-div-in-link-problem
If anything I think I would only accept a patch that uses filter_xss() on the non-link output, but we can't allow any additional tags in the link text.
Comment #9
hass commentedOk, but it works :-). Independed from the unsupported DIV inside the A... I need a link :-)
How can we solve the problem that the HTML code generated by the addressfield_tokens module works properly here? I'm not aware of any rule that say - module maintainers are not allowed to use DIV inside a token? How should we handle this in general?