I have this code:
%p
A debtor with the court's approval can hire attorneys via
%a{:id=>"proc",:href=>'/codes#rule327'}Section 327.
That renders:
A debtor with the court's approval can hire attorneys via Section 327.
I know this is extremely picky, but I do not want the period bolded. When I try:
%p
A debtor with the court's approval can hire attorneys via
%a{:id=>"proc",:href=>'/codes#rule327'}Section 327
\.
It yields:
A debtor with the court's approval can hire attorneys via Section 327 .
I would like to know how do I get:
A debtor with the court's approval can hire attorneys via Section 327.
HAML has helper methods specifically designed to "manipulate whitespace in a more precise fashion than what the whitespace removal methods allow."
There are three methods: surround, precede, and succeed, which provide better whitespace control. In your case, you can use the succeed helper like this to append the period after the link:
%p
A debtor with the court's approval can hire attorneys via
= succeed "." do
%a{:id=>"proc",:href=>'/codes#rule327'}Section 327
See the HAML documentation under "Helper Methods".
You can use the outer "space eater" (>) after the tag definition:
%p
A debtor with the court's approval can hire attorneys via
%a{:id=>"proc",:href=>'/codes#rule327'}>Section 327
.
Manual reference
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With