How to add Bold or Italic (INLINE) using Jade? * As markdown

There are several ways to make strong words in the same line of code using Jade to generate HTML?

I'm trying to use markup code like this. But does not work:

p Here is my **strong words** in my sentence! 

The only solution I found ( here ):

 p Here is my <strong>strong words</strong> in my sentence! 

Is there another way?
Thanks!

+5
source share
2 answers

You can use the span tag with the style attribute (or CSS class).

p Here is my&nbsp; span(style='font-weight:bold') strong words &nbsp;in my sentence!

Or you can do the same formatting (add line breaks and indentation) with strong tags.

p Here is my&nbsp; strong strong words &nbsp;in my sentence!

+1
source

For Pug or Jade, you need to wrap the item in a paragraph and use | to continue the line.

 p strong This Starts out strong | but finishes out not i quite | as bold. 

What will look like:

It starts with a strong one , but does not end exactly the same.

EDIT: As noted in the comments, you need extra space in front of each component since the pug does not add spaces. The above will be displayed as:

 <p><strong>This Starts out strong </strong> but finishes out not <i> quite </i> as bold.</p> 
+12
source

Source: https://habr.com/ru/post/1245170/


All Articles