What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 122 Stack Exchange communities.

Possible Duplicate:
Bold code in a question
Allow highlighting certain bits of a code fragment or quote

Is there a way to apply rich formatting to some parts of your code? Sometimes, I have to paste a really large body of code (in case of an SQL query, for eg) but the relevant part (according to me) is very less. I could chop that out, but maybe the other part of the code contains something related to current issue? So - can you highlight a like of code or a few words among a big body of code?

share|improve this question
The only way to do this now would be by using <pre><code> HTML tags, and then embedding tags like <strong> inside of that block. –  Cody Gray Apr 11 '12 at 15:01
@TheEstablishment: Can we agree on not doing that? Editing posts which are utilizing HTML instead of Markdown is a little bit annoying. –  Time Traveling Bobby Apr 11 '12 at 15:05
How about shortening the code, splitting it up or repeating the important few lines instead? –  Time Traveling Bobby Apr 11 '12 at 15:07
@Bobby: Oh, I'm very much against it. But it's the only solution to this "problem". –  Cody Gray Apr 11 '12 at 15:56
add comment

marked as duplicate by Time Traveling Bobby, Mat, Arjan, Cody Gray, Flexo Apr 11 '12 at 18:17

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

Sometimes, I have to paste a really large body of code

No, you don't.

If you are thinking of pasting so much code into a Stack Overflow question that you feel the need for formatting tools it is time for you to do a little work before you ask people to work for you: prepare a minimal working example that exhibits the problematic behavior.

If you solve the problem by doing so, good!

If you learn something in the process, good!

share|improve this answer
That's true. But I am working on a Ruby on Rails project, where creating a minimal working example would mean creating a whole new project with models and controllers and what not. But anyway, point noted. –  Saad Rehman Shah Apr 12 '12 at 4:23
add comment

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