You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Christine Chan (JIRA)" <ji...@apache.org> on 2014/03/19 20:03:43 UTC

[jira] [Commented] (WICKET-5242) Disable escaping of html tag attributes

    [ https://issues.apache.org/jira/browse/WICKET-5242?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13940847#comment-13940847 ] 

Christine Chan commented on WICKET-5242:
----------------------------------------

I may have a use case for this unless there is a workaround.

Currently I am using the AttributeModifier class to replace some javascript in the onclick tag of a element.

The problem is that with the escaping, the single quotes within my javascript are being escaped and I can no longer get the javascript to work correctly.

I am applying 

AttributeModifer("onclick", "showDetailedMsg('This is a detailed message'); return false");
to the tag below.
<a wicket:id="status" href="#" id="ok">ERROR</a>

However this becomes:

<a wicket:id="status" href="#" id="ok" onclick="showDetailedMsg(&#039;This is a detailed message&#039;); return false">ERROR</a>

> Disable escaping of html tag attributes
> ---------------------------------------
>
>                 Key: WICKET-5242
>                 URL: https://issues.apache.org/jira/browse/WICKET-5242
>             Project: Wicket
>          Issue Type: Improvement
>          Components: wicket
>    Affects Versions: 6.7.0
>            Reporter: Bertrand Guay-Paquet
>              Labels: escaping, html, tags
>
> Currently, all component tag attributes are escaped.With html5 data- attributes, much more values can be considered valid depending on the tag attribute and some should not be escaped.
> For example, bootstrap tooltips use the "data-title" attribute to set the content of a tooltip. Using Wicket's tag attributes, it's not possible to set the value "<b>hello world</b>" as the data-title since it is escaped.
> ComponentTag#writeOutput() is the method which calls Strings.escapeMarkup(value); and escapes tag values. This is called by Component#renderComponentTag().
> There should be a way to disable component tag escaping either per-tag or per-component.
> Reference email thread:
> http://apache-wicket.1842946.n4.nabble.com/AttributeModifier-with-html-in-the-attribute-tp4659206.html



--
This message was sent by Atlassian JIRA
(v6.2#6252)