Escape Control in Halogen Text/Button

Hi,

I am modifying a basic Halogen example with counter and buttons.
I tried to wrap button text with non-breaking spaces and make text bold, but all these formatting chars are showed as verbatim i.e. &nbsp;<b>-</b>&nbsp;

I see raw HTML might be dangerous, but there must a be way to do formatting.

You should use an \x style escape within the PureScript string, rather than an HTML escape.

2 Likes

Stepping back… What is the reason for doing this over using CSS to get padding and bold?

.FancyButton {
	padding-inline: 1ex;
	font-weight: 700;
}
1 Like

I’ve got a non-breaking space via hex encoding \x202f.

There is no particular reason, just started trying PureScript and Halogen and curios how much freedom and escape hatches I have. Type and strictness is good, but life usually is more complex :wink: