haskell - How to transform some Blaze `Html` before rendering it with Yesod? -
i have html entered user displayed in yesod template. transform html, stripping out style
attributes before gets rendered, cannot find out how.
if template contains #{ html }
can pass html
value through function writing #{ transform html }
, if transform
function has signature: transform :: html -> html
html
type defined blaze-html
here. problem see blaze not seem expose functionalities useful in order walk html tree, or descendents of given html
. strategies suggest? should try blaze internals?
i not sure whether should considered purely issue blaze. transforming html
elements not 1 of main use cases of blaze, problem needs tackled in context of rendering yesod
you have render text or bytestring first, blaze provides no means of analyzing content. can process data library html-conduit or tagsoup (which xss-sanitize does).
Comments
Post a Comment