Symbols near HAML expressions

In HAML, I often want to use a punctuation tag immediately after the tag. For example, I might want to highlight something in bold, but have a closing parenthesis. Formatting will look like this: (An approximate sentence with bold text .)

Note that the "bold text" is in bold, but the period and the closing bracket are "." are not.

The obvious HAML is as follows:

(Example sentence with %span.important bold text \.) 

but this creates additional space between "bold" and ".". Here is one way to do this:

 (Example sentence with %span.important bold text %span>\.) 

Where it encloses '.)' In the range with > , the space disappears. However, this requires an unnecessary interval.

Is there a way to get the desired result without an extra range?

+7
source share
1 answer

This source code snippet should not work in HAML at all:

 (Example sentence with %b bold text .) 

The third line will result in an Illegal element: classes and ids must have values error. It should be:

 (Example sentence with %b bold text \.) 

However, this simply fixes the code error. It still shows how you complain. I know only two ways to solve this problem:

  • Just use the embedded HTML tags in your HAML file: (Example sentence with <b>bold text</b>.)
  • Install maruku (or another gem) and do the following:
 :markdown (Example sentence with **bold text**.) 
+6
source

All Articles