• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Line breaks and paragraph breaks
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Line breaks and paragraph breaks


  • Subject: Line breaks and paragraph breaks
  • From: Gideon King <email@hidden>
  • Date: Thu, 13 Aug 2009 04:29:48 +1000

I am reading an attributed string and breaking it up into text runs using attributesAtIndex:longestEffectiveRange:inRange:, now I need to break the resulting ranges of text into any lines ends and paragraph ends that occur within the range, so that I can output <br /> and <p / > tags in the code at the line breaks and paragraph breaks respectively, and process the text between the line/paragraph breaks separately.

The problem is that getLineStart:end:contentsEnd:forRange: and getParagraphStart:end:contentsEnd:forRange: seem to both detect line breaks and call them paragraph breaks. I don't really understand what the difference is between these two methods. What does it count as a line and what as a paragraph? Seeing as a paragraph break is also counted as a line break, what is the best way to emit either a <p /> or a <br /> but not both? Is there a way of typing a line break (not a paragraph break) in an NSTextVew?

Any suggestions on the best way to handle this would be appreciated.

TIA

Gideon
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: Re: FSDetermineIfRefIsEnclosedByFolder(): No const for Cocoa's Temp Dir?
  • Next by Date: Re: [iPhone] CAKeyframeAnimation
  • Previous by thread: Re: CGImageRef printing issue
  • Next by thread: Releasing ivars in -didTurnIntoFault. Should set to nil?
  • Index(es):
    • Date
    • Thread