Skip to content

Instantly share code, notes, and snippets.

@freshtonic
Created April 23, 2010 02:18
Show Gist options
  • Save freshtonic/376081 to your computer and use it in GitHub Desktop.
Save freshtonic/376081 to your computer and use it in GitHub Desktop.
%p
Blah blah blah blah
%a(href='#foo') foo
and
%a(href='#bar') bar
\.
-# The problem with the above Haml fragment is that I am left with a space after <a href='#bar'>bar</a> and before the period.
-# Haml's whitespace removal does not resolve the issue, because it can either remove ALL whitespace
-# around an element or ALL whitespace within an element. Neither option seems to fit the bill.
-# AFAIK from reading the docs, you can't put whitespace removal around the text node either.
-# What's the (preferably clean) solution?
%p
Blah blah blah blah
%a(href='#foo') foo
and
<a href='#bar'>bar</a>.
-# works around the issue.
@auxesis
Copy link

auxesis commented Apr 28, 2010

@jeremyw oh rad, thanks for the heads up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment