Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by vexe · Oct 10, 2013 at 12:58 PM · formatformatting

How to apply code formatting, in a Numbered/Bulleted list?

I've always had trouble formatting my code, after I use a Numbered/Bulleted list - It just never formats for some reason. Like:

  1. ONE.

  2. TWO

  3. COPY/PASTE CODE HERE AND FORMAT IT.

Or

  • Point.

  • Another point.

  • public ILogger Logger { get; set; } public LoggingManager(ILogger logger) { Logger = logger; }

Ahhh, in a perfect world where I could format ^

I want it so that, I could put my code, after the number/bullet, like:

 N-
    CODE HERE

If I do that, I either get out of the list's sync, or it just won't get formatted.

Is this how this thing works in the first place, or I just don't know how? Of course, I didn't see anything about this in the "Unity answers tutorial video"

Thanks.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
2
Best Answer

Answer by Graham-Dunnett · Oct 10, 2013 at 03:46 PM

  1. One

  2. Two

  3. for (int i=0; i < 42; i++)

This uses the backtick character to format the code, it only works for one line.

  1. One

  2. Two

  3. //This is multiple //lines of code //but it's a pita to enter

This uses the code html tag and the br html tag at the end of lines. It requires quite a bit of manual work, since the markdown editor assumes every line you enter whilst in list mode is a new entry in the list. Which means cutting-and-pasting code is non-trivial.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image vexe · Oct 10, 2013 at 04:04 PM 0
Share

Thanks it works perfectly! - For those who don't know about the code tag (like me) - I actually thought it was [CODE] [/CODE] (like in forums) but it's actually < /code > And the breakline is just (without spaces)

avatar image
2

Answer by robertbu · Oct 10, 2013 at 03:51 PM

I too have problems code in relation to lists. That is, if I attempt to format code directly after a list, the formatting does not work correctly. The solution I've found is to put a line of 'normal' text or a dotted line followed by an empty line between the list and the code .

  • One

  • Two

  • Three


      #pragma strict
         
         function Start() {
         
         }
    
    

Without the line, the code would not format correctly.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image robertbu · Oct 10, 2013 at 04:09 PM 1
Share

Actually my problem appears to be different. I'm not trying to put code in a numbered list that continues. I'm just trying to paste code directly after a numbered list. The code does not format correctly even with extra lines between the list and the code.

avatar image vexe · Oct 10, 2013 at 04:11 PM 0
Share

Yes, I also suffered from this, along with what I asked about. But try the code and break tags, should work.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

16 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

I cant fix format truecolor. it not show.,I cant fix format true color. it not show. 0 Answers

Export objects to a .3DS file at runtime 1 Answer

Editing how bools appear in the Inspector 1 Answer

Texture formats missing.... 0 Answers

exec format error while installing the app on BB Simulator... 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges