Ticket #1941 (closed feature request)

Opened 5 years ago

Last modified 5 years ago

Add htmlAttr to Text.XHtml

Reported by: dsf Owned by: bjorn@…
Priority: normal Milestone: Not GHC
Component: libraries (other) Version: 6.6.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

It is necessary to allow HTML primitive characters such as "×" in string attributes, e.g.

<input type="image" src="delete.gif" alt="&times;" name=...>

However, passing "&times;" to strAttr results in an encoded string "&amp;times;", which doesn't render the nice little x we need. Attached is a patch to add an htmlAttr function so we can say

input ! [strAttr "type" "image", strAttr "src" "delete.gif", htmlAttr "alt" (primHtmlChar "times")]

Attachments

htmlattr.diff Download (2.2 KB) - added by dsf 5 years ago.
Patch to add htmlAttr function

Change History

Changed 5 years ago by dsf

Patch to add htmlAttr function

Changed 5 years ago by igloo

  • owner set to bjorn@…
  • difficulty set to Unknown
  • milestone set to Not GHC

A patch for you, Bjorn!

Changed 5 years ago by guest

  • status changed from new to closed

Pushed the attached patch.

Changed 5 years ago by simonmar

  • architecture changed from Unknown to Unknown/Multiple

Changed 5 years ago by simonmar

  • os changed from Unknown to Unknown/Multiple
Note: See TracTickets for help on using tickets.