Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

html

markdown

pug

There is some way to make strong some words in the same code line using Jade to generate the HTML?

I try to use markdown code, like this. But isn't working:

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

An unique solution that I found (here) was:

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

There any other way?

Thank you!

like image 866
romulobastos Avatar asked Mar 16 '16 15:03

romulobastos


People also ask

How to create bold italic text in Markdown?

Creating bold italic text is simply a matter of using both bold (two asterisks) and italic (one asterisk) at the same time, for a total of three asterisks on either side of the text you want to format at once. PDF - Download Markdown for free

How do you bold the middle of a word?

You will need two asterisks without spaces around each letter in order to bold the middle of the word in a way emphasizing its meaning. **bold text** is just what I love. How Do You Create Bold Or Italic Text Using Markdown?

How do I markup inside a code block in Markdown?

The original Markdown does not support markup inside code blocks. Nor do any other flavours of Markdown, to my knowledge. You could use inline HTML, if all your tools support it. Or you could highlight the code in some other way, e.g. surround it with comments.

How do I make a markdown file?

The best way to produce a Markdown file is with an application dedicated to it such as a spreadsheet or flowchart. Use the Markdown application to open the Markdown file. The Markdown document can be made HTML using the Markdown application.


1 Answers

For Pug or Jade, you need to wrap the element in a paragraph, and use the | for line continuation.

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

Which will look like:

This starts out strong but finishes out not quite as bold.

EDIT: As noted in the comments, you need an additional whitespace before each component, as pug doesn't add spaces. The above will render out as:

<p><strong>This Starts out strong </strong> but finishes out not <i> quite </i> as bold.</p>
like image 57
MrMowgli Avatar answered Sep 19 '22 12:09

MrMowgli