4

I couldn't find an answer here in the Markdown Editing Help page.

What I am trying to do is this:

This is a block quote area where I would put code or a quote and I can bold text and add a cool link to another post where I have an ugly horizontal scroll bar. I would like to use a block quote but the problem is that they don't allow for verticle spacing. Instead, when I write it just continues to word wrap and it makes code difficult to read.

However, I have another option.
I can use a code block that works very nicely 
but I can not **bold text** a particular part of the code
I want to stand out.
Just to make it easier to locate.
Nor can I make the font smaller and get rid of that ugly scroll bar. It's just slightly too wide.

Is this possible? Is there a work-around? I may have over -looked something in the Help page.

5

If you really need to bold text or other formatting inside a code block, then you have to use the plain HTML to create the code block, as the Markdown parser itself will not parse anything further inside a code block.

So this code:

<pre><code>However, I have another option.
I can use a code block that works very nicely 
but I can not <b>bold text</b> a particular part of the code
<a href="https://meta.stackexchange.com/q/243709">I want to stand out.</a>
Just to make it easier to locate.
Nor can I make the font smaller and get rid of that ugly scroll bar. It's just slightly too wide.</code></pre>

Will produce this:

However, I have another option.
I can use a code block that works very nicely 
but I can not bold text a particular part of the code
I want to stand out.
Just to make it easier to locate.
Nor can I make the font smaller and get rid of that ugly scroll bar. It's just slightly too wide.

It is not possible to get rid of the horizontal scrollbar when the text is too long to fit inside the box, nor would we want users changing the font size in order to achieve that effect. Changing font sizes would be incredibly irritating. If you're really concerned about the scrollbar, break your text into more manageable lines of code.


Reading your paragraph, though, it's not clear that you really need to use a code block, but have just missed the way to do line breaks inside a blockquote. You can do so by adding two spaces to the end of each line (or just using a <br> element), like so:

However, I have another option.
I can use a code block that works very nicely
but I can not bold text a particular part of the code
I want to stand out.
Just to make it easier to locate.
Nor can I make the font smaller and get rid of that ugly scroll bar. It's just slightly too wide.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .