AppKit NSAttributedString Document Types

Is there any documentation on the NSText* features supported by the various document types NSAttributedString can encode in AppKit?

For example if I create an NSTextTable (which works fine in RTF), how can I can know if it's supported in the following types:

  • DocFormat
  • WordML
  • OfficeOpenXML
  • OpenDocument

They mostly are not, and if I use merged cells (row/col spans) the support is even lower.

Similarly, if I wanted to use Markdown decoding support to encode to the HTML type, does AppKit provide translation from PresentationIntent to the NSText* implementations?

Answered by Frameworks Engineer in 892333022
  • DocFormat
  • WordML
  • OfficeOpenXML
  • OpenDocument

It's not officially documented, but we consider these file formats are for maintenance only.

We recommend primarily using RTF format for data exchange and persistence since it is the only format we provide the round-trip fidelity.

For loading HTML into NSAttributedString, we now recommend using the WebKit-based API declared in WebKit.NSAttributedString since it provides more controls than the convenience API in the base NSAttributedString.

Similarly, if I wanted to use Markdown decoding support to encode to the HTML type, does AppKit provide translation from PresentationIntent to the NSText* implementations?

We currently don't provide API for directly doing this via NSAttributedString.

  • DocFormat
  • WordML
  • OfficeOpenXML
  • OpenDocument

It's not officially documented, but we consider these file formats are for maintenance only.

We recommend primarily using RTF format for data exchange and persistence since it is the only format we provide the round-trip fidelity.

For loading HTML into NSAttributedString, we now recommend using the WebKit-based API declared in WebKit.NSAttributedString since it provides more controls than the convenience API in the base NSAttributedString.

Similarly, if I wanted to use Markdown decoding support to encode to the HTML type, does AppKit provide translation from PresentationIntent to the NSText* implementations?

We currently don't provide API for directly doing this via NSAttributedString.

Please file an enhancement request for the Markdown, presentation intent, and HTML translation in order to get visibility for our feature prioritization.

Thank you.

Thank you for clarifying. The Markdown/HTML question was strictly Markdown to NSAttributedString to HTML.

The Markdown/HTML question was strictly Markdown to NSAttributedString to HTML.

Yes. We're aware of increasing interests in this area. It always helps getting inputs like this in our consideration for the feature design and direction.

Thank you.

AppKit NSAttributedString Document Types
 
 
Q